Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with Outlook Automation
Message
De
31/07/2000 18:28:19
 
 
À
31/07/2000 12:07:22
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00398593
Message ID:
00399045
Vues:
28
Hi Tamar,

>Matt - I haven't worked with Outlook 98, but with Outlook 2000, you always need to call Outlook's GetNameSpace method after you open it:
>
>oNameSpace = oOutlookObject.GetNameSpace("MAPI")

It's difficult to argue with you, because I don't have Outlook 2000 to test on. I Know I do the above to retrieve info from Outlook 98 e.g.
*/////////////////////////////////////////////////
oOutLookObject = CreateObject("Outlook.Application")
olNameSpace = oOutlookObject.GetNameSpace("MAPI")
oTasks = olNameSpace.GetDefaultFolder(olFolderTask).Items
For nItem = 1 to oTasks.Count
   This.List1.AddListItem(ttoc(oTasks.Item(nItem).StartDate), nitem, 1)
   This.List1.AddListItem(oTasks.Item(nItem).Subject, nitem, 2)
Next nItem
release oTasks, olNameSpace, oOutLookObject
*/////////////////////////////////////////////////
However, the following will add a task item in Outlook 98:
*/////////////////////////////////////////////////
*// Folder Constants
#DEFINE olFolderCalendar 9
#DEFINE olFolderContacts 10
#DEFINE olFolderDeletedItems 3
#DEFINE olFolderInBox 6
#DEFINE olFolderJournal 11
#DEFINE olFolderNotes 12
#DEFINE olFolderOutBox 4
#DEFINE olFolderSentMail 5
#DEFINE olFolderTask 13
#DEFINE olBusy 2
#DEFINE True .T.
#DEFINE False .F.
#DEFINE olPrivate 2

*/ Importance Constants
#DEFINE olImportanceLow 0
#DEFINE olImportanceNormal 1
#DEFINE olImportanceHigh 2


*// Item Constants
#DEFINE olMailItem 0
#DEFINE olAppointmentItem 1
#DEFINE olContactItem 2
#DEFINE olTaskItem 3
#DEFINE olJournalItem 4
#DEFINE olNoteItem 5
#DEFINE olPostItem 6

*// Other Constants
#DEFINE olDiscard 1
#DEFINE olPromptForSave 2
#DEFINE olSave 0

*// Create the Outlook Object
oOutLookObject = CreateObject("Outlook.Application")
oTaskItem = oOutLookObject.CreateItem(olTaskItem)

WITH oTaskItem
   .Subject = "My Subject"
   .Body = "My Body"
   .StartDate = date()
   .DueDate = date() + 10
   .ReminderSet = True
   .ReminderTime = datetime() + 3600
   .Categories = "Personal"
   .close(olSave)
EndWith

release oTaskItem, oOutLookObject 
*/////////////////////////////////////////////////
Do you know if this has changed for Outlook 2000 ? I don't see where I would use olNameSpace when adding a task.

Best.

Matt.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform