Web Development

General discussion


Closing MS Project 2000 MSGBOX from VB6

By jhouck ·
I am trying to close a message box within MS PROJECT 2000 from VB6 using sendkeys. Automation fails when the sendkeys does not close a msgbox in the opened File:
Do Until objRS.EOF
strProjectName = strProjectDSN & Trim(objRS("PROJ_NAME"))
objProject.DisplayAlerts = False
objProject.FileOpen (strProjectName)
SendKeys "{ENTER}"
If objProject.Projects.Item(1).ReadOnly Then
GoTo EndofLoop
End If
I know that I am missing something

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

by Tony Hopkinson In reply to Closing MS Project 2000 M ...

Sendkeys are going to your application window not the dialog box for ms project would be my instant guess. When you want to send key strokes to another window, you need to get it's handle and then send the key stroke messages to it.
Look the up FindWindow, SendMessage and PostMessage APIs. I suspect you'll want the latter as it only returns to your code when the messages has been accepted whareas sendmessage is asynchronous.

Related Discussions

Related Forums