I have a simple problem, but I am not able to solve in.
I am programming in word 2003 vba. If the user clicks on a menü entry the frmTextmarkenEditor is show. The form tells the user that he should cklick on the document and a textmark or a formfield is created on the place he puts his mouse click.
To realize this I have created an event WindowSelectionChange wich opens another form for the user as soon as he clicks on the document.
After the form frmTextmarkenEditor is opened, modal = false, I am not able to activate the document in a way, that on the first click of the user the WindowSelectionChange is activated. The user has to click two times instead of one time to activate the WindowSelectionChange.
With the attached code I am able to activete thisdocument, but the cursor is not blinking and I think this is the reason why the user has to click two times to activate the WindowSelectionChange. With the attached code the user has to click two times to see the message SelectionEreignis even the form frmTextmarkeneditor has not the focus anymore.
I want to avoid that the user has to click two times.
Please help. How can I activate the document in a way so that with a single click of the user, the WindowSelectionChange is activated.
in this document:
Private WithEvents app As Application
Private Sub app_WindowSelectionChange(ByVal Sel As Selection)
If frmTextmarken2.Visible = False Then
'and this sub is my problem. It is called from a menu button
Public Sub TextmarkenEditor()
'MsgBox "TextmarkenEditor Aufruf"