Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Checking For Mail w/Outlook
Message
From
28/12/2001 04:51:05
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00598604
Message ID:
00598701
Views:
17
>Using Outlook, anyone know how to check for new email? I know how to check
>to see what's in the Inbox, but I want to check for new mail. This would be
>equivilent to clicking the Send/Receive button.

Hi Kevin,

having grubbed the Outlook help files for a Send/Receive method several times without success, I tried to figure out how to click the Send/Receive menu item through VBA. This is working for me (VFP 7, Win2k, Outlook XP):
LOCAL loOA,loAE,loMnuTools,loMnuItem


loOA = CREATEOBJECT("Outlook.Application")
loAE = loOA.ActiveExplorer
IF NOT ISNULL(loAE) AND (TYPE("loAE") == "O")
  loMnuTools = loAE.CommandBars.Item("Tools")
  loMnuItem  = loMnuTools.Controls("Senden/Empfangen").Controls("Alle senden und empfangen")
  loMnuItem.Execute()
ENDIF
loMnuItem  = .NULL.
loMnuTools = .NULL.
loAE       = .NULL.
loOA       = .NULL.
RELEASE lo*
You'll have to swap the german menu item captions with the english captions. Probably the menu structures are different in elder versions of Outlook. Would be interesting to hear about that...

HTH Robert
I've acquired quite a taste for a well-made mistake... [Fiona Apple]
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform