Form on top

G

George Brink

I can see how to make a form stay on top in VB, but not in Word VBA (Word
2002).

The call might be:
Call SetWinPos(SortForm.hwnd, True)
wirh the appropriate API code.

But VBA does not seem to support the property .hwnd

Can anyone help?
 
W

Word Heretic

G'day "George Brink" <[email protected]>,

The VBA Developer's Handbook has some tricky ideas for solving this.
However, forms have a modal property so I'm not really sure what is
the undesired effect you are attempting to overcome here?

Steve Hudson - Word Heretic
Want a hyperlinked index? S/W R&D? See WordHeretic.com

steve from wordheretic.com (Email replies require payment)


George Brink reckoned:
 
G

George Brink

I have a mdeless form sitting om top of a document. If I touch the document,
e.g, scroll the document, the form moves below it. I would like the form
always to stay on top. I can do it in VB but not in VBA.
Here is my (not so elegant) solution:


Public Sub KeepFormOnTop(end_KeepFormOnTop)
'An attemp to keep the form on top of the documents

b = 1
StattTime = Time

While b = 1
If end_KeepFormOnTop = False Then 'a global variable
Exit Sub
Else
For j = 1 To 50
DoEvents
Next
If (Timer - StattTime) > 1 Then
SortForm.Show
StattTime = Timer
End If
End If
Wend

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top