Opening Word Docmument Inline IE when Office 2007 Installed

Hi All,

When opening a Word document by following a link in IE, Office 2007 and Office 2003 behave differently. On a computer with Office 2003 installed, the document opens in the IE browser window. With Office 2007, the document opens in Word. Is there a way to open documents inline IE on clients with Office 2007 installed, or vice versa Or is there a technical document describing what happens when one clicks on a link pointing at a word document in IE

Thanks in advance,
B. G.


Answer this question

Opening Word Docmument Inline IE when Office 2007 Installed

  • DevDiver

    Rowena,

    Registry settings under HKEY_LOCAL_MACHINE affect all users of the machine; settings under HKEY_CURRENT_USER only apply to the current user. Most--but not all--Registry settings can be used in either place.

    Hope this helps...

    -- Lance



  • CodeCommando

    Hello again Bilge Gul,

    I figured this out finally. The link above indeed helps, but I think I found a better way. What I finally ended up doing is looking for (and adding if they don't exist) the following registry entries:

    *** VISTA and WORD 2007 Open In Place fix ***

    HKEY_CURRENT_USER\Software\Classes\Word.Document.8 --> create subkey BrowserFlags and assign it DWORD value of 0.

    HKEY_CURRENT_USER\Software\Classes\Word.Document.12 --> create subkey BrowserFlags and assign it DWORD value of 0x024 (36 decimal value).

    Creating and editing these keys prevents having the program to run as administrator (instead of editing the HKEY_CLASSES_ROOT section). -- The keys above should override what appears in the HKEY_CLASSES_ROOT.

    Here is my code if anyone is interested (you can cleanup and add own error catching):

    Version WordVersionVOBJ = new Version(this.wordVersion);
    if (WordVersionVOBJ.Major >= 12)
    {
    // check to see if registry key Word.Document.8 exists
    // The existance of this key with our modified BrowserFlags value will cause all 97-2003
    // docs to open In Place in web browsers (system wide)
    RegistryKey hkcr = Registry.CurrentUser; // open HKEY_CURRENT_USER
    RegistryKey myRegKey = null;

    try
    {
    myRegKey = hkcr.OpenSubKey(@"Software\Classes\Word.Document.8", true);

    // if the key didn't exist
    if (myRegKey == null)
    { // we must create it within this part of the registry

    // create the key
    hkcr.CreateSubKey(@"Software\Classes\Word.Document.8");

    // reattempt to open the key
    myRegKey = hkcr.OpenSubKey(@"Software\Classes\Word.Document.8", true);

    }

    // set browser flags to 0 because this will cause all Word 97 - 2003 documents to open within a web browser instead of externally
    // DEFAULT VALUE in VISTA: 0x08 (8)
    // DEFAULT VALUE in XP/2000: 0x00 (0) <--- these noted so we can perform cleanup later and restore correct values to registry
    myRegKey.SetValue("BrowserFlags", "0", RegistryValueKind.DWord);
    }
    catch (Exception exec)
    {
    // OWN ERROR HANDLING STUFF
    }

    // cleanup
    myRegKey.Close();

    // check to see if registry key Word.Document.12 exists
    // The existance of this key with our modified BrowserFlags value will cause all 2007
    // docs to open In Place in web browsers (system wide).
    try
    {
    // check to see if registry key Word.Document.12 exists
    myRegKey = hkcr.OpenSubKey(@"Software\Classes\Word.Document.12", true);

    // if the key didn't exist
    if (myRegKey == null)
    { // we must create it within this part of the registry

    // create the key
    hkcr.CreateSubKey(@"Software\Classes\Word.Document.12");

    // reattempt to open the key
    myRegKey = hkcr.OpenSubKey(@"Software\Classes\Word.Document.12", true);
    }

    // set browser flags to 0x024 because this will cause all Word 2007 documents to open within a web browser instead of externally
    // refer to article http://support.microsoft.com/kb/927009 for more information
    // DEFAULT VALUE in VISTA: 0x2C (44)
    // DEFAULT VALUE in XP/2000: 0x ( ) <--- these noted so we can perform cleanup later and restore correct values to registry
    myRegKey.SetValue("BrowserFlags", 0x024, RegistryValueKind.DWord);
    }
    catch (Exception exec)
    {
    // OWN ERROR HANDLING STUFF
    }

    // cleanup
    myRegKey.Close();
    hkcr.Close();
    } // end IF this computer is running Word version 2007

    ---

    Rob

  • vb_ff

    Hi RobKinney1

    How can i use this code could you explain to me Plz....
    because i could not
    figured out how to open Word 2007 Inside IE...
    ---------
    Thanks

  • Jonas.S

    This fix works for me, except that the registry values are found under HKEY_LOCAL_MACHINE instead of HKEY_CURRENT_USER.

  • Alatar

    Hello Bilge Gul,

    Thank you for your response. Indeed this works for XP, but have you tried this with Vista and Word 2007 Unfortunately this option is not available in Vista.

    I was browsing the web and came up with the following article:

    http://support.microsoft.com/kb/927009

    However, I cannot get this to work! One reason may be that they don't tell you whether you should be editing the Hex or the Decimal value that Regedit prompts you for. I have tried it both ways and still documents open externally in Word. I even am running my program with the "Run As Administrator" without any luck. I have also experimented putting the raw file path into an external instance of IE that was launched as the administrator. ... Still no luck. This is really frustrating.

    I will keep you posted if I figure out the answer for Vista and Word 2007....

    Thanks,

    Rob

  • Duncan_311

    Hi,

    We have been able to resolve the issue in the following way:

    Open "Windows Explorer > Tools > Folder Options > File Types"
    Choose the file extension, for example DOC
    Click the "Advanced" button
    Check "Browse in same window"

    The drawback is, this has to be done on all client computers. I think the Office 2007 installation clears the "Browse in same window" settings.

    Hope it helps,
    Bilge Gul


  • Nlepor

    Hello BilgeGul,

    Did you ever figure this out I am having the same problem.

    Thanks,

    Rob

  • Poppa Mike

    This was very helpful and solved issues for me - however I have a twist on this. I have a user with Vista and Word 2003 - how do I make that open inline with IE. Again Vista you must edit the registries.
  • VictorArce

    dont really need to code to do this. You just need to make sure the the browser flags attribute is set to 24 (hex) for EVERY version of word.document. The code only modifies this for version 12 documents. Great and all , but there are not a lot of documents out there that have been created with word 2007 yet. what is more useful is having all word documents open in line with office 2007. that is why you would want to update all of the versions of word.
  • Opening Word Docmument Inline IE when Office 2007 Installed