Public oForm oForm = Createobject("form") oForm.Width = 600 oForm.Height = 500 oForm.AddObject("grid1","grid") oForm.grid1.Width = 590 oForm.grid1.Height = 490 oForm.grid1.ColumnCount = 4 oForm.grid1.Visible = .T. Create Cursor myEmails (From c(20),daterec d,subject c(20),content M) oOutLookObject = Createobject("Outlook.Application") olNameSpace = oOutLookObject.GetNameSpace("MAPI") myEmails=olNameSpace.GetDefaultFolder(6).Items For Each loItem In myEmails If loItem.unread && Check if unread Insert Into myEmails (From,daterec,subject,content) Values; (loItem.sendername,loItem.ReceivedTime,loItem.subject,loItem.body) loItem.unread = .F. && Mark it as a read message Endif Next oForm.grid1.RecordSource="myEmails" Select myEmails Locate oForm.Show()>>I need an example of Outlook automation to read an entire folder of emails, such as scanning each email and getting access to its content.
Public oForm >oForm = Createobject("form") >oForm.Width = 600 >oForm.height = 500 >oForm.AddObject("grid1","grid") >oForm.grid1.Width = 590 >oForm.grid1.height = 490 >oForm.grid1.ColumnCount = 4 >oForm.grid1.Visible = .T. >Create Cursor myEmails (From c(20),daterec d,subject c(20),content M) >oOutLookObject = Createobject("Outlook.Application") >olNameSpace = oOutLookObject.GetNameSpace("MAPI") >myEmails=olNameSpace.GetDefaultFolder(6).Items >For Each loItem In myEmails > Insert Into myEmails (From,daterec,subject,content) Values; > (loItem.sendername,loItem.ReceivedTime,loItem.subject,loItem.body) >Next >oForm.grid1.RecordSource="myEmails" >Select myEmails >Locate >oForm.Show() >