A family of Microsoft word processing software products for creating web, email, and print documents.
Without using some API that I don't know about, this can be done with a little trickery.
Create another form the same size as your form of interest call it frmTemp. It the frmTemp module place the following code:
Option Explicit
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub UserForm_Activate()
DoEvents
Sleep 5 'That is 5 milliseconds
Unload Me
ThisDocument.Activate
End Sub
In a code module call the frmTemp and your frmOfInterest as follows:
Public Sub CallForm()
frmOfInterest.Show vbModeless
frmTemp.Show vbModeless
End Sub
Basically your frmOfInterest is displayed. Then it loses focus to frmTemp which loses focus to the document in 5 miliseconds.
Greg Maxey --- Visit my website at: http://gregmaxey.mvps.org/word\_tips.htm