B
Bo Hansson
Having read the MVP article "Making a UserForm show above a newly
created Word 2000+ document" I became interested to apply the idea in my
application. But I cannot get my code implementation to work. I have tried
the following:
______________________________________________________________
In a module of deklarations I've included:
Declare Function GetActiveWindow Lib "user32" () As Long
Declare Function SetParent Lib "user32" _
(ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Public iHandleForm As Long
Public iHandleDoc As Long
Public iNull As Long
______________________________________________________________
I always start code execution from a Windows menu that includes a number of
commands. As the very first action when activating my menu I now have:
Set oDoc = ActiveDocument
iHandleDoc = GetActiveWindow()
_____________________________________________________________
Later in the process I open a user form, and its Activate event starts with:
iHandleForm = GetActiveWindow()
iNull = SetParent(iHandleForm, iHandleDoc)
oDoc.Activate
_____________________________________________________________
All I achieve is that that Word freezes and refuses to respond to any
commands. What's wrong ?
/BosseH
created Word 2000+ document" I became interested to apply the idea in my
application. But I cannot get my code implementation to work. I have tried
the following:
______________________________________________________________
In a module of deklarations I've included:
Declare Function GetActiveWindow Lib "user32" () As Long
Declare Function SetParent Lib "user32" _
(ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Public iHandleForm As Long
Public iHandleDoc As Long
Public iNull As Long
______________________________________________________________
I always start code execution from a Windows menu that includes a number of
commands. As the very first action when activating my menu I now have:
Set oDoc = ActiveDocument
iHandleDoc = GetActiveWindow()
_____________________________________________________________
Later in the process I open a user form, and its Activate event starts with:
iHandleForm = GetActiveWindow()
iNull = SetParent(iHandleForm, iHandleDoc)
oDoc.Activate
_____________________________________________________________
All I achieve is that that Word freezes and refuses to respond to any
commands. What's wrong ?
/BosseH