|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Add internet header in Outgoing email? Sample Codetitle called lead ID: in the an outgoing mail and written a little test app below. It works but when delivered the extra header is not visible. What am I doing wrong? Any ideas gratefully received? I am using Redemption, Exchange Server 2007 and a mix of Outlook 2000/2002 and Outlook 2003. Thanks John Private Sub SendEmailTest() Dim SafeItem, oISendItem ' send email with attachment Set oOutlookApp = GetObject(, "Outlook.Application") Set SafeItem = CreateObject("SecureEmail.SafeMailItem") Set oISendItem = oOutlookApp.CreateItem(olMailItem) Set SafeItem.Item = oISendItem Tag = SafeItem.GetIDsFromNames("{00020386-0000-0000- C000-000000000046}", "x-test-header") Tag = Tag SafeItem.Fields(Tag) = "LEADID: 41567" 'MsgBox (SafeItem.Fields(Tag)) SafeItem.To = "helpd***@xxx.co.uk" SafeItem.Subject = "This is a Test" SafeItem.Save ' send the email with subject line and attached document SafeItem.Send ' make the email and objects nothing so resetting them Set oISendItem = Nothing Set oOutlookApp = Nothing End Sub When using GetIDsFromNames you must Or the result you get back with the type
of property tag, in this case PT_STRING8. So this line in your code: Tag = Tag Should be: Tag = Tag Or &H1E ' PT_STRING8 == 0x0000001E -- Show quoteHide quoteKen Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm <freeman***@gmail.com> wrote in message news:3e6abf8c-cd21-43df-a82b-65a3657e46cf@l33g2000pri.googlegroups.com... > Dear all, driving me a bit mad, need to add an email header with a > title called lead ID: in the an outgoing mail and written a little > test app below. It works but when delivered the extra header is not > visible. What am I doing wrong? Any ideas gratefully received? I am > using Redemption, Exchange Server 2007 and a mix of Outlook 2000/2002 > and Outlook 2003. Thanks John > > > Private Sub SendEmailTest() > Dim SafeItem, oISendItem > > ' send email with attachment > Set oOutlookApp = GetObject(, "Outlook.Application") > Set SafeItem = CreateObject("SecureEmail.SafeMailItem") > Set oISendItem = oOutlookApp.CreateItem(olMailItem) > > Set SafeItem.Item = oISendItem > > Tag = SafeItem.GetIDsFromNames("{00020386-0000-0000- > C000-000000000046}", "x-test-header") > Tag = Tag > SafeItem.Fields(Tag) = "LEADID: 41567" > 'MsgBox (SafeItem.Fields(Tag)) > SafeItem.To = "helpd***@xxx.co.uk" > SafeItem.Subject = "This is a Test" > SafeItem.Save > > ' send the email with subject line and attached document > SafeItem.Send > > ' make the email and objects nothing so resetting them > Set oISendItem = Nothing > Set oOutlookApp = Nothing > > End Sub Ken you are a genius, thank you so much. Cheers John
Show quoteHide quote On 15 Jan, 18:52, "Ken Slovak - [MVP - Outlook]" <kenslo***@mvps.org> wrote: > When using GetIDsFromNames you must Or the result you get back with the type > of property tag, in this case PT_STRING8. So this line in your code: > > Tag = Tag > > Should be: > > Tag = Tag Or &H1E ' PT_STRING8 == 0x0000001E > > -- > Ken Slovak > [MVP - Outlook]http://www.slovaktech.com > Author: Professional Programming Outlook 2007. > Reminder Manager, Extended Reminders, Attachment Options.http://www.slovaktech.com/products.htm > > <freeman***@gmail.com> wrote in message > > news:3e6abf8c-cd21-43df-a82b-65a3657e46cf@l33g2000pri.googlegroups.com... > > > > > Dear all, driving me a bit mad, need to add an email header with a > > title called lead ID: in the an outgoing mail and written a little > > test app below. It works but when delivered the extra header is not > > visible. What am I doing wrong? Any ideas gratefully received? I am > > using Redemption, Exchange Server 2007 and a mix of Outlook 2000/2002 > > and Outlook 2003. Thanks John > > > Private Sub SendEmailTest() > > Dim SafeItem, oISendItem > > > ' send email with attachment > > Set oOutlookApp = GetObject(, "Outlook.Application") > > Set SafeItem = CreateObject("SecureEmail.SafeMailItem") > > Set oISendItem = oOutlookApp.CreateItem(olMailItem) > > > Set SafeItem.Item = oISendItem > > > Tag = SafeItem.GetIDsFromNames("{00020386-0000-0000- > > C000-000000000046}", "x-test-header") > > Tag = Tag > > SafeItem.Fields(Tag) = "LEADID: 41567" > > 'MsgBox (SafeItem.Fields(Tag)) > > SafeItem.To = "helpd***@xxx.co.uk" > > SafeItem.Subject = "This is a Test" > > SafeItem.Save > > > ' send the email with subject line and attached document > > SafeItem.Send > > > ' make the email and objects nothing so resetting them > > Set oISendItem = Nothing > > Set oOutlookApp = Nothing > > > End Sub- Hide quoted text - > > - Show quoted text - Sorry Ken one more quick question, my text is
Tag = SafeItem.GetIDsFromNames("{00020386-0000-0000- C000-000000000046}", "ARM-LeadID") But when it adds the ARM-LeadID it adds it as lower case, can this be changed, doesnt really matter, just interested really. Thanks John Show quoteHide quote On 16 Jan, 08:04, "freeman***@gmail.com" <freeman***@gmail.com> wrote: > Ken you are a genius, thank you so much. Cheers John > > On 15 Jan, 18:52, "Ken Slovak - [MVP - Outlook]" <kenslo***@mvps.org> > wrote: > > > > > When using GetIDsFromNames you must Or the result you get back with the type > > of property tag, in this case PT_STRING8. So this line in your code: > > > Tag = Tag > > > Should be: > > > Tag = Tag Or &H1E ' PT_STRING8 == 0x0000001E > > > -- > > Ken Slovak > > [MVP - Outlook]http://www.slovaktech.com > > Author: Professional Programming Outlook 2007. > > Reminder Manager, Extended Reminders, Attachment Options.http://www.slovaktech.com/products.htm > > > <freeman***@gmail.com> wrote in message > > >news:3e6abf8c-cd21-43df-a82b-65a3657e46cf@l33g2000pri.googlegroups.com.... > > > > Dear all, driving me a bit mad, need to add an email header with a > > > title called lead ID: in the an outgoing mail and written a little > > > test app below. It works but when delivered the extra header is not > > > visible. What am I doing wrong? Any ideas gratefully received? I am > > > using Redemption, Exchange Server 2007 and a mix of Outlook 2000/2002 > > > and Outlook 2003. Thanks John > > > > Private Sub SendEmailTest() > > > Dim SafeItem, oISendItem > > > > ' send email with attachment > > > Set oOutlookApp = GetObject(, "Outlook.Application") > > > Set SafeItem = CreateObject("SecureEmail.SafeMailItem") > > > Set oISendItem = oOutlookApp.CreateItem(olMailItem) > > > > Set SafeItem.Item = oISendItem > > > > Tag = SafeItem.GetIDsFromNames("{00020386-0000-0000- > > > C000-000000000046}", "x-test-header") > > > Tag = Tag > > > SafeItem.Fields(Tag) = "LEADID: 41567" > > > 'MsgBox (SafeItem.Fields(Tag)) > > > SafeItem.To = "helpd***@xxx.co.uk" > > > SafeItem.Subject = "This is a Test" > > > SafeItem.Save > > > > ' send the email with subject line and attached document > > > SafeItem.Send > > > > ' make the email and objects nothing so resetting them > > > Set oISendItem = Nothing > > > Set oOutlookApp = Nothing > > > > End Sub- Hide quoted text - > > > - Show quoted text -- Hide quoted text - > > - Show quoted text - It doesn't matter and you can't control the casing.
-- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm <freeman***@gmail.com> wrote in message news:d1f08d10-f17c-4e36-8e5b-7e53fcc2c051@v4g2000vbb.googlegroups.com... Sorry Ken one more quick question, my text isTag = SafeItem.GetIDsFromNames("{00020386-0000-0000- C000-000000000046}", "ARM-LeadID") But when it adds the ARM-LeadID it adds it as lower case, can this be changed, doesnt really matter, just interested really. Thanks John
outlook 2003 sometimes turns off rule
Running an Excel macro via Outlook reminder Moving messages from inbox Delete files in a sub folder using VBA Send an e-mail to a Group e-mail using Excel VBA Attachment Problem How to have multiple macros with shared event handlers? Custom Pane/Custom Interface Linking Access To Outlook Selection Form on custom Contacts form - popup |
|||||||||||||||||||||||