Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Outlook: save in a specific folder
Message
From
12/12/2007 14:11:23
 
 
To
11/12/2007 16:12:04
Bruno Maddalozzo
Informatica Aziendale
Arsie, Italy
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
01274939
Message ID:
01275261
Views:
10
This message has been marked as a message which has helped to the initial question of the thread.
Does redemption make a difference?
m.loOutLook = CREATEOBJECT('Outlook.Application')
m.ReItem = CREATEOBJECT('Redemption.SafeMailItem')
m.loNamespace = m.loOutLook.GetNamespace("MAPI")
m.ReItem.Item = loNameSpace.GetDefaultFolder(16).Items.Add() && 9 add a worddoc, 8 add an xls, ...
m.ReItem.Recipients.Add("tome@mail.com")
m.ReItem.Recipients.ResolveAll()
m.ReItem.Subject = "This is the subject"
m.ReItem.Body = "This is the body of the email"
m.ReItem.Save()
>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
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform