Bajrang


Hi,All
I want to show a message box when user click my custome send button to sending a Mail Item. Everything is working fine but Messagebox in not showing in current window (that is Mail Item), but it is showing in parent window of OUTLOOK. To see this message I have to move into OUTLOOK's main window.
There in no much coding , I don't know where the problem is
Please help me out.
my code is here please have a look

Private Sub btnNewSend_Click(ByVal Ctrl As Office.CommandBarButton, CancelDefault As Boolean)
Dim mTo As String
'mailGo = ""
Dim mCc As String
Dim mBcc As String
Dim msgstring As String
mTo = Trim(newMail.To)
mCc = Trim(newMail.CC)
mBcc = Trim(newMail.BCC)
If mTo = "" And mCc = "" And mBcc = "" Then
myolApp.ActiveInspector.WindowState = olMinimized
msgstring = "Outlook Keyword Plug-in has detected that you have not specified any recipients for this message. Do you wan to send this search to keyword server "
Reply = MsgBox("Outlook Keyword Plug-in has detected that you have not specified any recipients for this message." & vbCrLf & " Do you want to send this search to keyword server ", vbYesNo + vbQuestion, "Keyword Plug-in")
If Reply = vbNo Then
CancelDefault = True
myolApp.ActiveInspector.WindowState = olMaximized
Exit Sub
Else
newMail.To = "xx@yy.com"
End If
End If
newMail.Send
End Sub
__________________
I am using VB.NET 2005
and VB 6.0 for Office Development




Re: messageBox not showing in current window

Bajrang


That message was not appearing in current window that's why I minimize(myolApp.ActiveInspector.WindowState = olMaximized ) that current window to see that message and after clicking the message I maximize that current window(myolApp.ActiveInspector.WindowState = olMaximized ). Obeviously this is not good.
So please help so that I can get the message box in that current window itself.
Thanks