make Word be on to top

WayneFrank

Member
I am doing a Word merge in Progress. When I use the command

chWordApp:visible = TRUE.

it does make it visible. My question is, how can I make Word be on to top the other windows? Is there a way to do that?

Thanks
 
it's always on top for me. 10.1b,win7,word2007

Code:
DEF VAR WRD-APP AS COM-HANDLE.
  CREATE "Word.Application" WRD-APP NO-ERROR.
  wrd-app:VISIBLE = FALSE.
  wrd-app:Options:VirusProtection(False) NO-ERROR.
  wrd-app:Documents:OPEN(WRD-DOCFILE).
  wrd-app:activedocument:mailmerge:opendatasource(WRD-MERGEFILE).
  wrd-app:activedocument:SAVEas(WRD-DOCFILE).
  wrd-app:VISIBLE = TRUE.
  wrd-app:ACTIVATE.
  RELEASE OBJECT wrd-app.
  ASSIGN wrd-app = ?.
 
For starters, what are your versions of Progress, Windows, and Word? Depending on your Windows version there may be different behaviours.

I think you would need to resort to the Win32 API. Look into the SetForegroundWindow function implemented in user32.dll; it takes an HWND as input (the com-handle from your "create word.application" statement). As I said you may not get the results you want on later versions of Windows.
 
Windows 7
Progress 9
Word 2007


For starters, what are your versions of Progress, Windows, and Word? Depending on your Windows version there may be different behaviours.

I think you would need to resort to the Win32 API. Look into the SetForegroundWindow function implemented in user32.dll; it takes an HWND as input (the com-handle from your "create word.application" statement). As I said you may not get the results you want on later versions of Windows.
 
How about the one I gave you? Declare the SetForegroundWindow as an external procedure in your ABL program and pass it the handle to the Word instance. Bear in mind that Windows 7 is less permissive about letting applications "steal focus", so you may just be able to get it to flash its taskbar button to indicate it wants focus. Read the MSDN documentation, and give it a try and see.
 
Back
Top