View Single Post
  #2   Report Post  
AA2e72E
 
Posts: n/a
Default

Try (in a module):

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal
lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As
Long) As Long
Sub FL()
Dim lHandle As Long
lHandle = FindWindow("OpusApp", vbNullString)
If 0 lHandle Then SetForegroundWindow (lHandle)
End Sub


"bh" wrote:

I've actually done a lot of Mailmerge related driving of Word for years using
OLE, but the one nagging problem is there does not seem to be a method
equivalent to Windows' SetForegroundWindow().
Our app's users really don't want to have to click the taskbar after already
starting a merge. Is there an undocumented Application method to do this?
Or a property where I can get the window handle?
Thanks!