General discussion

Locked

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:
objRS.MoveFirst
Do Until objRS.EOF
strProjectName = strProjectDSN & Trim(objRS("PROJ_NAME"))
DoEvents
objProject.DisplayAlerts = False
objProject.FileOpen (strProjectName)
SendKeys "{ENTER}"
If objProject.Projects.Item(1).ReadOnly Then
objProject.FileClose
GoTo EndofLoop
End If
I know that I am missing something

This conversation is currently closed to new comments.

1 total post (Page 1 of 1)  
| 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.

Back to Web Development Forum
1 total post (Page 1 of 1)  

Related Discussions

Related Forums