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()
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"