Which object shoudl have that event? I trigger the "Send/Receive All" by
executing the Menu option in Outlook (but from the VB code)
' Get the Inbox.
Dim oFolder As MAPIFolder =
nSpace.GetDefaultFolder(OlDefaultFolders.olFolderI nbox)
' Get Explorer for the folder.
Dim oExp As _Explorer = oFolder.GetExplorer(False)
' Get the Menu bar.
Dim oCmdBars As _CommandBars = oExp.CommandBars
Dim oCmdBar As CommandBar = oCmdBars("Menu Bar")
Console.WriteLine(oCmdBar.Name)
Dim oBarCrls As CommandBarControls = oCmdBar.Controls
Console.WriteLine(oBarCrls.Count)
' Get the Tools menu.
Dim oBPop As CommandBarPopup = CType(oBarCrls("Verktyg"), CommandBarPopup)
'Dim oBPop As CommandBarPopup = CType(oBarCrls("Tools"), CommandBarPopup)
Console.WriteLine(oBPop.Caption)
oBarCrls = oBPop.Controls
' Get the Send/Receive menu.
Dim oSendReceive As CommandBarPopup = CType(oBarCrls("Skicka och ta emot"),
CommandBarPopup)
'Dim oSendReceive As CommandBarPopup = CType(oBarCrls("Send/Receive"),
CommandBarPopup)
Console.WriteLine(oSendReceive.Caption)
' Get the Send and Receive All menu.
oBarCrls = oSendReceive.Controls
'TO DO: If you use the Microsoft Outlook 11.0 Object Library, uncomment the
following line.
Dim oSendReceiveAll As CommandBarControl = CType(oBarCrls("Skicka och ta
emot alla"), CommandBarControl)
'Dim oSendReceiveAll As CommandBarControl = CType(oBarCrls("Send/Receive
All"), CommandBarControl)
Console.WriteLine(oSendReceiveAll.Caption)
' Do the action.
oSendReceiveAll.Execute()
/Lars
"Atul" <atulatsswaredotcom> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
I think you must subscribe to one of the events which is fired when the
Send/Receive command is complete. I don't know the name of the event but
there must be such an event.
-Atul, Sky Software http://www.ssware.com
Shell MegaPack For ActiveX & .Net - Windows Explorer Like Shell UI
Controls
"Lars Netzel" <ui****@adf.se> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl... Hello!
I need to Send/Receive in Outlook from vb.net and have followed this code
(It's c# but it works fine in VB.NET after translating too)
http://support.microsoft.com/default.aspx?id=310251
Anyway... to summarize the code.. I loop thru the menu options in Outlook
to in the in trigger the "Send/Receive All" option that will show the
popup for this...
This pops up and runs until it's done but how can I determine in my
VB.CODE when that popup is do newith it's actions?
What my program does is that it asumes everything is downloaded to the
inbox and I can't start until I'm sure everything is downloaded.. so
please how do I do that?
best regards
/Lars netzel