Procedure to detect a running application and to register it.

G

Guest

I have the following Procedure:

Sub DetectExcel()
Const WM_USER = 1024
Dim hWnd As Long
hWnd = FindWindow("XLMAIN", 0)
If hWnd = 0 Then
Exit Sub
Else
SendMessage hWnd, WM_USER + 18, 0, 0
End If
End Sub

Obviously this applies to Excel. How do I accomplish the same thing but to
Microsoft Word?

Thanks,
Bill
 
T

Trevor Shuttleworth

The question doesn't seem a lot different to when you asked it three minutes
previously under a different name. Nevertheless, it might have more success
in a Word Group

Regards

Trevor
 

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