Office 365 Word can't be embed in place inside Windows native application

700 Views Asked by At

I embed Office Word in a .NET application using MFC COleDocObjectItem. I use DoVerb(OLEIVERB_SHOW,...) to show Word. Until very recently it was working well, Word could be embed in place normally inside the application. But with newer version (2204 16.0.15128.20178) of Office 365, Microsoft Word always popup out of the application on some Windows 10 machines but not all.

We noticed on two machines where the issue happened the same dump showing an issue in MFC140u: Faulting application name: XXXXXXXXXXX.exe, version: X.X.X.X, time stamp: 0x6194d628 Faulting module name: mfc140u.dll, version: 14.10.25017.0, time stamp: 0x58a64535 Exception code: 0xc0000005 Fault offset: 0x000000000028318d Faulting process id: 0x4304 Faulting application start time: 0x01d87515fd8b29c9 Faulting application path: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Faulting module path: C:\Windows\System32\mfc140u.dll Report Id: afb20b8f-5f55-4b23-992d-8c5088a8d955 Faulting package full name: Faulting package-relative application ID:

That looks very similar to what is described here with another Microsoft Office application: Office 365 Excel can't be embed in place inside Windows native application

We tried to uninstall Office and reinstall it but it didn't fix the problem.

We tried to remove Office completely using Microsoft tool and reinstall it, but it didn't solve the issue either.

We are guessing some environmental issues or registry issues but so far we have not ben able to reproduce on other machines and we have not been able to figure out what the issue could be.

We just diagnosed that it is happening with Version 2206 Build 16.0.15330.20002.

Any help will be very appreciated.

Thanks

1

There are 1 best solutions below

0
On

@Soko,

The issue is DPI related. There has been a change in MS-Word enforcing additional DPI related requirements for OLE in-place activation. The most recent versions Office will check if the DPI values of the embedded Office app and the container app are equal, if a difference is found Office does not open embedded.

Therefore, you need to set the DPI awareness of your application 'i.e. container) through the manifest of the application. Setting the DPI awareness in the config file is not enough. Check these articles from Microsoft, they should point you to the changes required:

We applied the changes required and it work now with the latest version of MS-Word (2206 and above).

Hope this will help.

Hugues