Hello,
how to programatically close outlook model pop up in vb6.0?
Thanks,
Krunal
Printable View
Hello,
how to programatically close outlook model pop up in vb6.0?
Thanks,
Krunal
Do you mean that dialog the pops up?
Yes,
I have model pop up open in outlook and when i try to send mail from my VB application then outlook gives error like "A dialogue box is open. Close it and try again."
When do you receive the pop up?
While I am pressing a 'send' button to send a mail.
I am getting error at OutMail.Display.
While that is not the message I was thinking of I think that two can only be hidden using a third-party add-in. Have a look at Redemption (see post #2 for link) that might do what you need.
Thanks for the solution, but is there any other way that can solve my problem?
can we have some outlook properties or code that can check or close the popup programatically? I don't want to use any third party add-in.
There might be a way if you reference Microsoft Outlook from within your program.
you may be able to use API from your vb program to find the window and close, findwindow, findwindowex and sendmessageQuote:
I don't want to use any third party add-in.
no code will run in outlook or outlook object while dialog is open
best to find what fires the error dialog and prevent its occurrence
Hi Nightwalker83,
I found the solution.what I did, I programatically kill that pop up and then open my outlook window. below is my code:
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Public Const WM_CLOSE = &H10
Public Sub Kill_Program(ProgramName As String)
Dim WinWnd As Long
'Stop
WinWnd = FindWindow(vbNullString, ProgramName)
If WinWnd <> 0 Then
MsgBox "Outlook E-mail Properties Popup will be closed."
PostMessage WinWnd, WM_CLOSE, 0&, 0&
' Else
' ' do nothing or
' MsgBox "No Popup of name " & ProgramName & " exists."
End If
End Sub
Ref Link:
http://www.vbforums.com/showthread.p...ocess-from-VB6
hope it will help others also.
Thanks
Glad you found a solution! Don't forget to mark the thread "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.