Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Outlook Automation

Status
Not open for further replies.

ChrisRChamberlain

Programmer
Mar 23, 2000
3,392
GB
I am trying to automate Outlook from Visual Foxpro using the following code.

_VFP.OLEServerBusyRaiseError = .T.
_VFP.OLERequestPendingTimeout = 0
_VFP.OLEServerBusyTimeout = 5000

oOutlook = CREATEOBJECT("Outlook.Application")

oLogon = oOutlook.GETNAMESPACE("MAPI")
oLogon.LOGON()

oOutlook.CREATEITEM(1)
oMail = oOutlook.CREATEITEM(0) && olMailItem

WITH oMail
[tab].SUBJECT = [Hello World]
[tab].BODY = [This is a test]
[tab].TO = [anyone@anywhere.com]
[tab].SEND
ENDWITH

What I need would like to know is how to get Outlook to make an Internet connection, assuming it's offline, BEFORE the preceding code is executed, and thus immediately send the e-mail.

TIA

Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top