473,394 Members | 1,751 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Determine when an operation in other thread is done?

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

Nov 21 '05 #1
3 1953
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


Nov 21 '05 #2
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



Nov 21 '05 #3
oh, I worked it out... I missed the declaration WithEvents... of course
there were events for SyncStart and SyncStop

thank you!

/Lars
"Lars Netzel" <ui****@adf.se> wrote in message
news:uD**************@TK2MSFTNGP09.phx.gbl...
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




Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: John Bentley | last post by:
John Bentley: INTRO The phrase "decimal number" within a programming context is ambiguous. It could refer to the decimal datatype or the related but separate concept of a generic decimal number....
3
by: Web Webon | last post by:
Hi everybody! I wonder if this is possible? I need to determine if a client is using "windows classic folders" or anything else. If I instantiate a Shell ActiveX object is there a way of...
22
by: Bradley | last post by:
Has anyone else noticed this problem? I converted the back-end to A2000 and the performance problem was fixed. We supply a 97 and 2000 version of our software so we kept the backend in A97 to make...
7
by: Bernard Lebel | last post by:
Hello, I'm stumbled at a serious problem, and quite frankly getting desparate. This is a rather long-winded one so I'll try to get straight to the point. I have this Python program, that...
30
by: Charles Law | last post by:
Here's one that should probably have the sub-heading "I'm sure I asked this once before, but ...". Two users are both looking at the same data, from a database. One user changes the data and...
22
by: semedao | last post by:
Hi , I am using asyc sockets p2p connection between 2 clients. when I debug step by step the both sides , i'ts work ok. when I run it , in somepoint (same location in the code) when I want to...
7
by: semedao | last post by:
Hi all, I view many posts about this issue , the connected property does not tell us the current status of the socket. based on couple of suggestions of msdn , and some article here , I try to...
94
by: Samuel R. Neff | last post by:
When is it appropriate to use "volatile" keyword? The docs simply state: " The volatile modifier is usually used for a field that is accessed by multiple threads without using the lock...
3
by: Giampaolo Rodola' | last post by:
Hi, I'd like to know if there's a way to determine which is the best buffer size to use when you have to send() and recv() some data over the network. I have an FTP server application which, on...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.