Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Outlook: save in a specific folder
Message
De
11/12/2007 16:12:04
Bruno Maddalozzo
Informatica Aziendale
Arsie, Italie
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Outlook: save in a specific folder
Divers
Thread ID:
01274939
Message ID:
01274939
Vues:
52
I'm trying to automate Outlook to save messages in FolderDrafts.
I've found that with the following code NOT always messages as saved there,
but sometimes in Received emails, other times elsewhere.

m.loOutLook = CREATEOBJECT('Outlook.Application')
m.loOutLookItem = m.loOutLook.CreateItem(0)
m.loOutLookItem.TO = "To Send To"
m.loOutLookItem.Subject = "Here subject"
m.loOutLookItem.Body = "Here body"
m.loOutLookItem.Save()

So I tried to select the draft folder (or, to test, other folders) but got error in marked lines:


m.loOutLook = CREATEOBJECT('Outlook.Application')
m.loOutLookItem = m.loOutLook.CreateItem(0)
m.loOutLookItem.TO = "To Send To"
m.loOutLookItem.Subject = "Here subject"
m.loOutLookItem.Body = "Here body"
m.loNamespace = m.loOutLook.GetNamespace("MAPI")
*m.loFolder = m.loNamespace.GetDefaultFolder(16) && olFolderDrafts = 16
*to test
m.loFolder = m.loNamespace.GetDefaultFolder(5) && olFolderSentMail = 5
*m.loOutLook.ActiveExplorer.CurrentFolder = m.loFolder &&this gives error
*m.loOutLook.ActiveExplorer.SelectFolder(m.loFolder) &&this gives error too
*
m.loOutLookItem.Save() &&it's saved (usually in olFolderDrafts , but not always!?)

So my question is, which is the code to shurely select a specific folder where the Save() method stores the message?

TIA
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform