MS Word doesn't show on screen

214 Views Asked by At

My PCs OS are windows 11 and windows 7. I am writing an app that opens a MS Word document by clicking on a file name on a grid (see the screenshot below).

I use the commands:

aWordApplication.Visible = True
aWordApplication.Documents.Open(aFileName)
aWordApplication.Activate

Doing this, MS Word application runs (see the Word icon on the taskbar on the screenshot). The problem is that I have to click the word icon to see the actual document. This problem happens on windows 7 and windows 11. But it doesn't happen when I test the app from IDE. I run the App as administrator, it doesn't help either.

Would you please help me to fix the problem, let a document straightly opens on top of windows? Thanks. enter image description here

0

There are 0 best solutions below