ViewKind Parameter Ignored in ProjectItem.Open if ProjectItem is Set to Open With Default External Editor

Hi all,
In my VS2010 extension, I have just encountered a situation which I can find no workaround for. As always, I went to Carlos Quintero's MZ-Tools first to see if I could find an answer. In this excellent article of his (http://www.mztools.com/articles/2007/mz2007027.aspx),
he discusses how to get "the ProjectItem in the desired view using ProjectItem.Open(viewKind), which returns an EnvDTE.Window object."
This is the behavior I have experienced until I noticed that if a user selects "Open With..." and sets a default external program to open a given item with, I can no longer programmatically open the item in the text editor (this is required
functionality for my extension, since I am not setting the Window to visible, anyway). The screenshot below illustrates my point, even though I am working with my own custom extensions.
In this case, calling ProjectItem.Open with every available ViewKind value will cause Program.cs to open in Notepad rather than the text editor. The Window returned from the Open call is always null in this case.
Is there any way I can force an item to open in the text editor, regardless what its default program/viewer is? Thanks for your help,
-Mike

I don't think that is a bug but a limitation of the automation model.
As workaround, you can use the following method:
IVsUIShellOpenDocument.OpenSpecificEditor
If you want something somewhat more palatable you can use the following method:
VsShellUtilities.OpenDocumentWithSpecificEditor
Editor guids are stored in the registry entry HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0_Config\Editors, but since you are only interested in the text editor guid, you are lucky because there is already a constant defined Microsoft.VisualStudio.VSConstants.GUID_TextEditorFactory.
There is also a constant defined for the logical view: Microsoft.VisualStudio.VSConstants.LOGVIEWID.TextView_guid.
So, even if text files are set to open with Notepad, this code should open them in the text editor:
         string fullPath;
         Guid editorGuid;
         Guid logicalViewGuid;
         IVsWindowFrame windowFrame;
         fullPath = projectItem.get_FileNames(0);
         editorGuid = Microsoft.VisualStudio.VSConstants.GUID_TextEditorFactory;
         logicalViewGuid = Microsoft.VisualStudio.VSConstants.LOGVIEWID.TextView_guid;
         windowFrame = Microsoft.VisualStudio.Shell.VsShellUtilities.OpenDocumentWithSpecificEditor(this, fullPath, editorGuid, logicalViewGuid);
         if (windowFrame != null)
            windowFrame.Show();
* My new blog about VSX: http://www.visualstudioextensibility.com * Twitter: https://twitter.com/VSExtensibility * MZ-Tools productivity extension for Visual Studio: http://www.mztools.com.

Similar Messages

  • I have set up photoshop elements as external editor in iPhoto but I cannot get the edited photo to open in iPhoto. When I save the photo Elements asks where do I want to save it and iPhoto is not an option.

    I have set up Photoshop Elements11 as the External Editor in iPhoto just as Terence Devlin said. However when I save the edited photo it does not appear in iPhoto. A drop down menu asks where I want to save the photo and I do not know what to choose. Also should I choose, "save" or "save as"? I should be really grateful for your help.

    I suggest opening iPhoto and reverting back to iPhoto in the Preferences for photo editing. Quit iPhoto. Restart your Mac for good measure. Open iPhoto and again choose Photoshop Elements in Preferences as the editing app.
    As far as editing, I don't have PE, but I have another editing app form the Mac App Store, ColorStrokes. I have been experimenting with using it for editing iPhoto photos and it works flawlessly. After setting ColorStroke as the editing app, I open a photo in iPhoto and click the Edit button in the menu bar below the photo. Color Stoke immediately opens with the photo and I complete my editing. When I have finished editing I choose to Save the photo, leave the name the same and agree to replace the iPhoto photo of the same name. I quit ColorStroke and the photo in iPhoto now has all of my edits from ColorStroke.
    Should I decide that I prefer the original photo, I open the photo in iPhoto and choose Revert to Original in the Photos pulldown menu.

  • When link is opened by clicking middle button, it appears in tab toolbar;but when opened via left button (set to open in new tab) it is not shown - hidden under BACK key? I'd like left clicked tabs shown. & use mid.button for Enter.

    Windows XP; FireFox 4.0
    Would like not to have to use any keyboard shortcuts.

    No. The Tab bar is a regular toolbar in current Firefox versions, so you get the normal right-click context menu of a toolbar if you right-click the tab bar.
    You can double click on empty space on the tab bar to open a new tab if you do not want to use the new tab button.<br />
    You can drag a link on that new tab button to open that link in a new tab.<br />
    You can also drag the new tab button on another toolbar if you would like that better.<br />
    Open the Customize window via "View > Toolbars > Customize" or via "Firefox > Options > Toolbar Layout"<br />

  • Safari will not open on Desktop when set to open at Log In

    I have tried everything. Even called the Apple Tech guy and he said he had NEVER heard of this.
    I go into System Pref. Go to Accounts - set Safari to open at Log in. Set Quicken to open at Log in. Set Stickies to open at Log in. (none are "checked" to hide)
    I log out. . . . I log in. Stickies opens on the desktop - Quicken opens on the Desktop. Safari, IS open in the dock (little blue dot indicates the program is open) but my home page is NOT open on the desktop. I got it to work once. I recently upgraded to Snow Leopard. However, it does this on my computer at home AND at work so I'm thinking it's a glitch somewhere?

    HI, (love your username)! and welcome to Apple Discussions...
    Try deleting this file.
    com.apple.loginitems.plist
    ~/Library/Preferences.
    Move that file to the Trash and restart your Mac.
    If that doesn't help, go to System Preferences/Accounts - Login Items.
    Remove Safari, then add it back in. Restart your Mac.
    You can reset your Safari homepage by going to Safari/Preferences - General.
    Where you see; Home page: type in the url you want or navigate to that web site and click:
    Set to Current Page.
    Carolyn

  • Changing color space when opening in external editor

    Hi
    Is it possible to have aperture open a raw file in Photoshop in a colourspace other than Adobe RGB and also in 8bit rather than 16bit.
    Also I notice that it only saves as PSD or TIFF if you want to have the retouched file linked to the original master. Is there a work around to change this to jpeg but maintain the link to the master file.
    Thankyou

    OK
    I understand why, in the interest of maintaining max file integrity that apple restricts exporting to 16bit and PSD or TIF.
    However Adobe 98 is'nt always the best or most convenient colourspace to open a file with an external editor. What i'm looking is the option to change the export colourspace.
    PS: I'm only looking for the option when using the 'Open In External Editor' option. I know when exporting files out of aperture that there are many more options.
    Thanks

  • Can't open image in external editor, can't export images

    Greetings helpful Aperture experts,
    I've just finished transferring aperture from one computer to a replacement unit. Except for being slow on my previous g5, it worked flawlessly at every level. However, now that I've xferred, I can't open Aperture images with an external editor, nor can I export the images to my desktop. Any help along these lines will be gigantically appreciated.
    gaylon

    Thanks, ok, here is the info step by step:
    When I try to pick any raw image, I am not able to export from Aperture. When I go into the finder and select "show master" then I am able to export from aperture. However, it seems that I am not able to export an image full size. I selected export image to full size jpg to my desktop. Nothing happens except that the window that indicates the image is exporting is open and it says estimated time less than a minute. Yet, there is nothing happening. Additionally, before I transferred Aperture over to my new g5, I could right click an image and had the option to open an image with external editor. Now, no such menu item is apparent. An update, the menu box that lets me know that my image is exporting is still open but there has been no progress. It will just sit there forever, or until I force Aperture to quit. Here's another strange goings on: One of my folders of raw images appear to be pixelated and of very poor quality, even when viewing the masters. The images have already been published by the client in their annual report, so I know that what I am seeing on the screen is not reality. Should I just uninstall Aperture and reinstall? Also, what will this do to the thousands of images in my libraries? Thanks so much for your input and help. In no way am I an expert, but I've been successfully using Aperture since it came out. That was on my G5 dual processor mac with pre intel configuration. Now, these strange things are happening with my new replacement G5 with the Intel processors. Thanks again.
    gaylon wampler

  • External editor - open in Camera raw

    Can i, when using photoshop Cs3 as external editor, make Aperture open the dmg
    file in Camera raw, Just like Adobe Bridge does?
    Now, when i open a file from Aperture into Photoshop it just opens in... well,Photoshop!
    ( Cannot find External editor choice for Camera raw...)
    Yeah,guess i´m stupid.....
    Regards,T

    No, you can't do this.
    Currently 'Open in external editor' will always render the image version to a TIFF or JPEG prior to opening it with the external editor.
    If you want to send it to ACR, or any other raw converter, you will need to do that yourself, before importing the resulting image (back) into Aperture.
    (There's a few threads here which discuss workflows for this in more detail. But they all amount to workarounds for something Aperture isn't currently intended to support.)

  • Images won't open in Adobe external editor

    I can't get my images to open up in Photoshop eventhough it is set up as my external editor. When I select a picture to open with via the chosen external editor, a second version of my original is made within Aperture(with the external editor badge on it), Photoshop proceeds to open, but the image does not open in Photoshop to allow for edits.
    Can someone recommend a fix?

    Are you using CS2 or CS3? There might be something weird going on with the emulation if you're using CS2.
    Barring that, I'd open up Aperture, set the external to nothing, quit Aperture, reopen, then reset it to PS again. Kind of a pain, but stuff like that has worked in the past for me. Also, do you have the latest version of Aperture (1.5.3)? If not, update.
    You might also want to try pointing it to a different external editor – if it works on the alternate one, then it might have something to do with your Photoshop installation, which then might necessitate a reinstall.
    My last (well, 2nd last to uninstalling and reinstalling Aperture) suggestion would be to repair permissions and cross my fingers.

  • I noticed when I restart Firefox 4, it opens my previous tabs even I set the option "Open a blank page" and it opens blank page when I have "Show my windows and tabs from last time". Please ignore my question if you're already aware of this issue. Thanks.

    I noticed when I restart Firefox 4, it opens my previous tabs even I set the option "Open a blank page" and it opens blank page when I have "Show my windows and tabs from last time". Please ignore my question if you're already aware of this issue. Thanks.

    Your previous tabs will not re-open or be available to re-open when starting Firefox if:
    *your previous session was in Private Browsing mode; see --> http://support.mozilla.org/en-US/kb/Private+Browsing
    *you use Clear Recent History (''Firefox button > History > Clear Recent History'' or ''Tools > Clear Recent History''); see --> https://support.mozilla.org/en-US/kb/Clear%20Recent%20History#w_how-do-i-clear-my-history
    *you clear History automatically when closing Firefox; see --> https://support.mozilla.org/en-US/kb/Clear%20Recent%20History#w_how-do-i-make-firefox-clear-my-history-automatically
    NOTE: Your third-party Plugins (Add-ons > Plugins) are not in the "Application Basics" (Troubleshooting Information) in the "More system details" of your original post. Third-party Plugins are categorized separately in "Installed Plugins" under "More system details". You should review but not change the Plugins as detected automatically by the software on this forum when posting a question.
    If you problem still exists after checking the above, the problem could be caused by one or more of your Extensions or Plugins:
    *See --> [http://support.mozilla.org/en-US/kb/Troubleshooting+extensions+and+themes Troubleshooting extensions and themes]
    *See --> [http://support.mozilla.org/en-US/kb/Troubleshooting+plugins Troubleshooting plugins]
    *See --> [http://support.mozilla.org/en-US/kb/Basic+Troubleshooting Basic Troubleshooting]
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''

  • Oracle 10.2.0.4 MAXTRANS parameter ignored message

    Hello all,
    Does anybody have an idea why this error is occuring during an FULL export of the DB, all works well though.
    Should i be increasing a parameter just not to have it reported in alert.log.
    The value (30) of MAXTRANS parameter ignored.
    kupprdp: master process DM00 started with pid=66, OS id=1360
    to execute - SYS.KUPM$MCP.MAIN('SYS_EXPORT_FULL_01', 'SYSTEM', 'KUPC$C_1_20090622180005', 'KUPC$S_1_20090622180005', 0);
    kupprdp: worker process DW01 started with worker id=1, pid=67, OS id=2920
    to execute - SYS.KUPW$WORKER.MAIN('SYS_EXPORT_FULL_01', 'SYSTEM');
    Thanks

    From 10g onwards, there is no need to set the parameter Maxtrans as Oracle automatically puts the number of slots to 255. If you set a value for this for a segment specifically the message as like is shown , is written in the alert log and the value given is ignored.
    HTH
    Aman....

  • The value (30) of MAXTRANS parameter ignored.

    I am getting the following error....
    Tue Feb 05 20:31:05 2013
    The value (30) of MAXTRANS parameter ignored.
    kupprdp: master process DM00 started with pid=49, OS id=6824
    to execute - SYS.KUPM$MCP.MAIN('SYS_EXPORT_SCHEMA_30', 'ORISSA_TRANSACTION', 'KUPC$C_1_20130205203106', 'KUPC$S_1_20130205203106', 0);
    kupprdp: worker process DW01 started with worker id=1, pid=51, OS id=9036
    to execute - SYS.KUPW$WORKER.MAIN('SYS_EXPORT_SCHEMA_30', 'ORISSA_TRANSACTION');
    Please suggest a solution...

    rp0428 wrote:
    What are you doing when you get that error? Using expdp?
    See if this thread is the same issue and cause of yours.
    value (30) of MAXTRANS parameter ignored
    Yes, EXPDP.....

  • Maxtrans parameter ignored

    I am recieving message "The value(30) of maxtrans parameter ignored" When i run export for particular schema. Please tell me the possible cause of this message. Due to this message i am not able to export the user schema. I am using oracle 10g and i 'm doing export with expdp command.
    Thanks

    Hi,
    it is simple..
    If you search in the docs you will find this paragraph.
    MAXTRANS Parameter
    In earlier releases, the MAXTRANS parameter determined the maximum number of concurrent update transactions allowed for each data block in the segment. This parameter has been deprecated. Oracle now automatically allows up to 255 concurrent update transactions for any data block, depending on the available space in the block.
    So, as it is deprecated it will be ignored.
    Regs,
    Acr

  • Since the update I can no longer open a link from an email opened PDF file. I could prior to update

    Since the update I can no longer open a link from an email opened PDF file. I could prior to update

    Try this  - Reset the iPad by holding down on the Sleep and Home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons. (This is equivalent to rebooting your computer.) No data/files will be erased.
     Cheers, Tom

  • I purchased a book..it's in my library..but it won't open up. How do I open it up?  I am able to open up all of my free books.

    I bought a iBook for my ipad2.  It's in my library on the shelf but I cannot open it.  Can anyone tell me how.... Please  .

    If tapping on it doesn't open it, then there are a few things hat you could try. Assuming that the books is still available in the store then you could try deleting it and re-downloading it.
    You could also try closing the iBooks app completely and then seeing if you can open that book when you re-open the app : from the home screen (i.e. not with iBooks 'open' on-screen) double-click the home button to bring up the taskbar, then press and hold any of the apps on the taskbar for a couple of seconds or so until they start shaking, then press the '-' in the top left of the iBooks app to close it, and touch any part of the screen above the taskbar so as to stop the shaking and close the taskbar.
    Another option is a reset : press and hold both the sleep and home buttons for about 10 to 15 seconds (ignore the red slider), after which the Apple logo should appear - you won't lose any content, it's the iPad equivalent of a reboot.
    After that it's probably a case of deleting the iBooks app itself and then re-downloading/syncing it and all your books - in which case you should first make sure that you've either got copies of all of the books on your computer or that they are still available for re-download from the store. You will also lose any notes/highlights that you've made in the app

  • Generally when creating a Word file from either a Mac or Win7 pc and opening it on two different machines (either one first) it always prompts that the file is open and will be opened as read only. However opening a CSS file does not prompt that it is alr

    Generally when creating a Word file from either a Mac or Win7 pc and opening it on two different machines (either one first) it always prompts that the file is open and will be opened as read only.
    However opening a CSS file does not prompt that it is already open on or from any machine which is causing code edits to be lost.
    What we found from out testing:
    - The file can be saved from one user to the server and WILL NOT PROMPT on other machines until the saving machine has the Dreamweaver program closed completely
    - The file can be closed and  Dreamweaver minimised to the launch bar but it still will not register on other machines that it has been changed.
    - Also, until the  Dreamweaver program is closed on the machines, it will continue to open it's saved version of the file. 
    Example Scenario:
    - User 1 opens test.css (which is 2000 lines) and adds some code to the end of the file to bring it up to 2500 lines
    - Meanwhile User 2 opens test.css as well (opens as 2000 lines as User 1’s edits have not yet been saved) and adds in code to bring it to 2300 lines
    - User 1 saves his file and closes it - but  Dreamweaver is still open.
    - User 2 also saves his file and leaves  Dreamweaver  open.
    - The server will report the size and last edit of the file the same as User 2 as he was the last person to save it (and if you open from the Win7 Machine it will show as User 2’s 2300 line version)
    - If User 1 then open's the file again (from either the 'recent' in Dreamweaver OR clicking on the file directly in Finder...which version opens.... The version that User 1 saved! Not the true version on the server, but the version that User 1 edited and saved with 2500 lines in it.
    - Same for User 2, he will open 'his' version with 2300 lines in.
    Other information:
    - Files are opened directly from the server
    - Sometimes the users will save incrementally and re-open
    - Most of the time users will save incrementally and keep the files open
    - The users will never not save incrementally and just save when closing the file once finished
    - The users are usually working on the files all day
    - It is always the bottom lines of code that are lost. It could be a case of the two versions being mixed up and cutting off the newly added lines based on the line count (possibly).
    It is as if Dreamweaver is holding a cache of the version locally and then only properly looking back to the server when it has been completely closed. It is very difficult to see how the server is causing such an impact on these files, there are very few logs which are giving any indication to the root cause of the problems.
    Anyone know if this is a known issue?
    Is there a way that there can be a featured implemented on the server that doesn't allow another user to open a file if it is already open on another machine?
    Thanks

    Your server file handling has nothing, and really nothing to do with Adobe software. If files don't get locked for (over-)writing and/or lose connection to the program opening them, then your server is misconfigured. It's as plain and simple and that. Anything from "known file types"/ file associations not being set correctly, MIME types being botched, crooked user privileges and file permissions, missing Mac server extensions, delayed file writing on the server, generic network timeout issues and what have you. Either way, you have written a longwinded post with no real value since you haven't bothered to provide any proper technical info, most notably about the alleged server. Either way, the only way you can "fix" it is by straightening out your server and network configuration, not some magic switch in Adobe's software.
    Mylenium

Maybe you are looking for

  • Worst customer support experience!

    I bought a brand new Toshiba 40" (40FT2U) in January 2012.  On April 4, it died.  Toshiba reports that it is a failed Mainboard and would arrange for someone to replace the bad part.  As of April 16, the part is still on back order and there is no et

  • My iPod 4th gen will not do anything but scroll and occasionally flash the Apple logo for a few seconds

    Last night while I was trying to delete an app, my iPod crashed. Usually it will restart just fine but it has not sucessfully turned off or restarted as far as I can tell. It stays on the black screen with the scrolling white wheel in the center and

  • "My folders" and "Shared Folders" are not appearing

    Hi All, "My folders" and "Shared Folders" are not appearing after integrating with BI server(11.1.1.1.5). Any help? Regards, Kishore P

  • Backup causing problems with IFS files being locked

    We are having occasional but significant problems with our regular IFS backups. The symptom is that random SAP batch jobs, or tp processes will fail overnight. These seem to be related to the IFS backup running at the time, and appear to be that batc

  • HTML Email Pages

    Hello; and Happy New Year! I am a newbie and have Adobe Web Premium CS2/CS3. I would like to send an e-mail to contacts that announce our new company and website location, as well as links to the website so that they can register for courses. Is Drea