Award
Award

Reputation: 1

Word no longer embeds after windows update using AxSHDocVw.AxWebBrowser

We have been using AxSHDocVw.AxWebBrowser for some time embed word for mailmerge template creation but as of windows update July 12, 2022—KB5015807, this no longer works.

We expect the windows application to be embedded into the AxWebBrowser control like so : [Shows an image of the expected result for and embedded word application window][1] [1]: https://i.sstatic.net/tqwNi.png

however since the update the application now opens in a seperate window (its own word instance) and has no ribbin bar menu items : Shows that the word document is opened it is own instance with 'Document in internet explorer - Word' as the instance title

This has been an issue before but was easily fixed buy running the following registry fix file :

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Word.Document.8] "BrowserFlags"=dword:80000024

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Word.RTF.8] "BrowserFlags"=dword:80000024

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Word.Document.12] "BrowserFlags"=dword:80000024

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Word.DocumentMacroEnabled.12] "BrowserFlags"=dword:80000024

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Excel.Sheet.8] "BrowserFlags"=dword:80000A00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Excel.Sheet.12] "BrowserFlags"=dword:80000A00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Excel.SheetMacroEnabled.12] "BrowserFlags"=dword:80000A00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Excel.SheetBinaryMacroEnabled.12] "BrowserFlags"=dword:80000A00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\PowerPoint.Show.8] "BrowserFlags"=dword:800000A0

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\PowerPoint.Show.12] "BrowserFlags"=dword:800000A0

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\PowerPoint.ShowMacroEnabled.12] "BrowserFlags"=dword:800000A0

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\PowerPoint.SlideShow.8] "BrowserFlags"=dword:800000A0

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\PowerPoint.SlideShow.12] "BrowserFlags"=dword:800000A0

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\PowerPoint.SlideShowMacroEnabled.12] "BrowserFlags"=dword:800000A0

We are using AxSHDocVw.AxWebBrowser to do this, code for loading the file into the browser below

 public void LoadDocument(int? documentId, bool hideDocument)
    {
        _templateVersionDataRow = 
             Business.BusinessLogic.DocumentTemplate.GetLastVersion(documentId);

        _filePath = String.Format("{0}{1}.doc", Path.GetTempPath(), Guid.NewGuid());

        File.WriteAllBytes(_filePath, _templateVersionDataRow.Template);

        if (!hideDocument)
            BrowserFrame.Navigate(_filePath);
    }

Upvotes: 0

Views: 428

Answers (1)

Nick Astles
Nick Astles

Reputation: 1

I have experienced the same issue and think it may be related to a Word update rather than the KB you stated. I have used the WebBrowser control to embed Word documents for many years with different Operating Systems and different versions of Word. We too have used the registry settings to make the Word documents load inside the control and not separately in Word. But it seems to have stopped working after upgrading from O365 version 2205 to a later version (e.g. 2207). I think Windows Defender may also contribute to the issue. I would be interested to get an update on any fix/workaround you may have found. Thanks

Upvotes: 0

Related Questions