Someone else suggested AppActivate "Microsoft Word", true and this worked fine
except that if Word was already opened and the user had iconised it, it remained
iconised. In the end I adopted Methods 2 and 3 in Article ID: Q147816 and used
the Win32 API FindWindow function to get hWnd. The class name for Word
is "OpusApp" (the window name is the one in the task bar). Here are some snippets
which if used in conjunction with the code in the article will enable you to
maximize the Word window and bring it to the top even if the user has minimised
the window beforehand.
Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName
As Any, ByVal lpWindowName As Any) As Long
Const lpClassName = "OpusApp"
hWnd = FindWindow(lpClassName, 0&)
Mike
Quote:
-----Original Message-----
My problem is that after using automation to create a Word application and load a
document, the window containing the instance of Word is maximised but behind the
window containing the Access 2000 database. You have to click on the task bar
icon to bring it to the fore. Anybody tell me how to have the Word window always
on top after the Access vba code has stopped running?
Mike
.