Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
LOCAL oOutlook,oNameSpace,oDefaultFolder
oOutlook = CREATEOBJECT('outlook.application')
oNameSpace = oOutlook.getnamespace('MAPI')
oDefaultFolder=oNameSpace.GetDefaultFolder(olFolderCalendar) &&Calendar
oDefaultFolder.display()
LOCAL oOutlook,oNameSpace,oDefaultFolder
oOutlook = CREATEOBJECT('outlook.application')
oNameSpace = oOutlook.getnamespace('MAPI')
oDefaultFolder=oNameSpace.GetDefaultFolder(olFolderContacts) &&Contact
oDefaultFolder.display()
oOutlook=CREATEOBJECT('outlook.application')
oNameSpace=oOutlook.getNameSpace('mapi')
oDefaultFolder=oNameSpace.getdefaultfolder(10)
oDefaultFolder.items
oItem=odefaultFolder.Items.Find('[BalanceDue]=500')
oItem.display()
CREATE CURSOR myCursor (Name c(40),email c(50))
LOCAL oOutlook,oNameSpace,oDefaultFolder
oOutlook = CREATEOBJECT('outlook.application')
oNameSpace = oOutlook.getnamespace('MAPI')
oDefaultFolder=oNameSpace.GetDefaultFolder(olFolderContacts)
oItems = oDefaultFolder.items
FOR EACH oItem IN oItems
INSERT INTO myCursor (name,email) VALUES (oItem.fullname,oItem.email1address)
ENDFOR
SELECT myCursor
BROWSE
LOCAL oOutlook,oNameSpace,oDefaultFolder
oOutlook = CREATEOBJECT('outlook.application')
oNameSpace = oOutlook.getnamespace('MAPI')
oDefaultFolder=oNameSpace.GetDefaultFolder(10)
loNewContact = oDefaultfolder.Items.Add()
loNewContact.Fullname = 'Mike Gagnon'
loNewContact.UserProperties.Add('Amount', 14)
loNewContact.UserProperties('Amount').Value = 100.00
loNewContact.save()
MESSAGEBOX(TRANSFORM(loNewContact.UserProperties('Amount').Value))
loNewContact.display
Local oOutlookObject,olNameSpace
#Define olFolderInBox 6
oOutlookObject = Createobject('Outlook.Application')
olNameSpace = oOutlookObject.GetNameSpace('MAPI')
oItems= olNameSpace.GetDefaultFolder(olFolderInBox).Items
For Each loItem In oItems
If loItem.unRead
**Do something here
loItem.unRead = .F. && Mark it as read
Endif
Next
CREATE CURSOR myCursor (start T,end T,body c(250))
LOCAL oOutlook,oNameSpace,oDefaultFolder
oOutlook = CREATEOBJECT('outlook.application')
oNameSpace = oOutlook.getnamespace('MAPI')
oDefaultFolder=oNameSpace.GetDefaultFolder(olFolderCalendar)
oItems = oDefaultFolder.items
FOR EACH oItem IN oItems
INSERT INTO myCursor (start,end,body) VALUES (oItem.start,oItem.end,oItem.body)
ENDFOR
SELECT myCursor
BROWSE
#DEFINE olFolderCalendar 9
LOCAL oNameSpace, oDefaultFolder,oItems
oOutlook = CreateObject("Outlook.Application")
oNameSpace = oOutlook.GetNameSpace("MAPI")
oDefaultFolder = oNameSpace.GetdefaultFolder(olFolderCalendar)
FOR EACH oItem IN oDefaultFolder.items
IF oItem.Subject = 'All day meeting'
lDelete = oItem.Delete
ENDIF
ENDFOR
oOutLookObject = CreateObject('Outlook.Application')
oEmailItem = oOutLookObject.CreateItem(MAILITEM)
WITH oEmailItem
.Recipients.Add('moe@3stooges.com') && uses the Recipients collection
.Subject = 'Automation sample'
.Importance = IMPORTANCENORMAL
.Body = 'This is easy!'
.Send
ENDWITH
RELEASE oEmailItem
RELEASE oOutLookObject
oOutLookObject = CreateObject('Outlook.Application')
oEmailItem = oOutLookObject.CreateItem(MAILITEM)
WITH oEmailItem
.Recipients.Add('moe@3stooges.com') && uses the Recipients collection
.Subject = 'Automation sample'
.Importance = IMPORTANCENORMAL
.Body = 'This is easy!'
.Attachments.Add('c:\mydir\sample.txt') && Note that the fully qualified path and file is required.
.Send
ENDWITH
RELEASE oEmailItem
RELEASE oOutLookObject
Local lcFilename,lcPath
lcPath='c:\savedattachments\'
If !Directory('c:\savedAttachments')
Md 'c:\savedAttachments' && Create the directory if it doesn't exist.
Endif
oOutLookObject = Createobject('Outlook.Application')
olNameSpace = oOutLookObject.GetNameSpace('MAPI')
myAtts=olNameSpace.GetDefaultFolder(olFolderInbox).Items
For Each loItem In myAtts
If loItem.attachments.Count >0 && Make sure there is an actual attachment.
For i = 1 To loItem.attachments.Count
lcFilename='
lcFilename = loItem.attachments.Item(i).filename
lcFilename = Alltrim(lcPath)+lcFilename
loItem.attachments.Item(i).SaveAsFile(lcFilename)
*loItem.Delete() && The option to delete the message once the attachment has been saved.
Next
Endif
Next
LOCAL oOutlook,oNameSpace,oDefaultFolder,oItems
oOutlook = CREATEOBJECT('outlook.application')
oNameSpace = oOutlook.GetNameSpace('mapi')
oDefaultFolder = oNameSpace.GetDefaultfolder(olFolderContacts)
oItems=oDefaultFolder.items
FOR EACH loItem IN oItems
IF loItem.FULLNAME = 'Mis'
loItem.Email1Address = 'mis@suntel.ca'
loItem.Save()
ENDIF
ENDFOR
Local oOutlook,oNameSpace,oNewFolder
oOutlook=CREATEOBJECT('outlook.application')
oNameSpace=oOutlook.GetNamespace('mapi')
oNewFolder=oNameSpace.Folders(2).Folders.Add('myNewFolder') && This will create a folder in the Personal folders' directory of Outlook.
#DEFINE olFolderInBox 6
Local oOutlook,oNameSpace,oDefaultFolder
oOutlook=CREATEOBJECT('outlook.application')
oNameSpace=oOutlook.GetNamespace('mapi')
oDefaultFolder =oNameSpace.Getdefaultfolder(olFolderInBox)
oFolders=oDefaultFolder.folders
FOR EACH oFolder IN oFolders
?oFolder.name
ENDFOR
Local oOutlookObject,olNameSpace
#Define olFolderInBox 6
oOutlookObject = Createobject('Outlook.Application')
olNameSpace = oOutlookObject.GetNameSpace('MAPI')
oItems= olNameSpace.GetDefaultFolder(olFolderInBox).Items
For Each loItem In oItems
If !loItem.unRead
loitem.Move(olNameSpace.Folders(1).Folders(12))
Endif
Next
#DEFINE VFPCOM_CLSID 'VFPCOM.COMUTIL'
#DEFINE OUTLOOK_CLSID 'OUTLOOK.APPLICATION'
public goVFPCOM, goOutlook, goLink
goVFPCOM = create(VFPCOM_CLSID)
goOutlook = create(OUTLOOK_CLSID)
goLink = create('OutlookApplicationEvents')
goVFPCOM.BindEvents(goOutlook, goLink)
DEFINE CLASS OutlookApplicationEvents AS custom
PROCEDURE ItemSend(Item,Cancel)
ENDPROC
PROCEDURE NewMail
MessageBox('New Mail Has Arrived')
ENDPROC
PROCEDURE OptionsPagesAdd(Pages)
ENDPROC
PROCEDURE Quit
ENDPROC
PROCEDURE Reminder(Item)
ENDPROC
PROCEDURE Startup
ENDPROC
ENDDEFINE