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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read email subject lines from outlook mailbox 1

Status
Not open for further replies.

DChalom

Programmer
Jun 8, 2002
59
US
Would someone be willing to help me get started by giving me a "push" in the right direction to create a simple program that would read emails from a Outlook inbox and save the subject lines to a database?

Dorian C. Chalom
 
Dorian C. Chalom


Code:
#Define olFolderInBox 6
Create Cursor myCursor (subject c(40))
Local oOutlook,oNameSpace,oDefaultFolder
oOutlook = Createobject('outlook.application')
oNameSpace = oOutlook.getnamespace('MAPI')
oDefaultFolder=oNameSpace.GetDefaultFolder(olFolderInBox)
oItems = oDefaultFolder.items
For Each oItem In oItems
    If oItem.unread = .T. && Assuming you only want the unread messages.
		Insert Into myCursor (Subjectl) Values (oItem.subject)
	Endif
Endfor


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Thanks Mike. You always have the answers.....

Dorian C. Chalom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top