![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Can someone confirm that the Outlook 2003 COM object model does not
provide a way to programmatically get, modify, or remove the signature line of an email? Furthermore, it doesn't look like Redemption RDO supports manipulating the signature line either (http://www.google.com/search?q=signature +site%3Ahttp%3A%2F%2Fwww.dimastr.com%2Fredemption %2F&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en- US ![]() I've noticed that a SafeMailItem will contain the signature line as long as I don't modify the Body property. Has anyone else noticed that? Thanks, Jeff |
Ads |
#2
|
|||
|
|||
![]()
It certainly is possible to add a signature to an email message. If Word is the editor, it's also easy to remove it, because it's exposed as a Bookmark object. See http://www.outlookcode.com/codedetail.aspx?id=615. If Word is not the email editor, the signature is not distinguished in any way from the rest of the text.
-- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Jeff" wrote in message oups.com... Can someone confirm that the Outlook 2003 COM object model does not provide a way to programmatically get, modify, or remove the signature line of an email? Furthermore, it doesn't look like Redemption RDO supports manipulating the signature line either (http://www.google.com/search?q=signature +site%3Ahttp%3A%2F%2Fwww.dimastr.com%2Fredemption %2F&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en- US ![]() I've noticed that a SafeMailItem will contain the signature line as long as I don't modify the Body property. Has anyone else noticed that? Thanks, Jeff |
#3
|
|||
|
|||
![]()
Thanks for the link.
I did not see the text of the signature in the value of the Body property of Redemption's SafeMailItem, as one might expect. Based on that test, also I assume that the signature would not appear in RDO.RDOMail.Body, .HTMLBody, .RTFBody either, but I didn't take the time to test those. I didn't see a ".Signature" property or equivalent in Outlook COM, Redemption Safe* items, or Redemption RDO objects. Am I missing something? In my install of Outlook 2003 (Word as Editor, HTML format by default) the signature line is getting added as long as I don't manipulate the SafeMailItem.Body property. Is that expected? Thanks, Jeff |
#4
|
|||
|
|||
![]()
There is no Signature property. The operations I describe do not depend on there being one.
It might help if you showed some code. Without that, we have no way of knowing in what order you're performing operations, etc. If you overwrite the Body property, for example, any signature that already exists is going to be replaced by your new Body text. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Jeff" wrote in message ups.com... Thanks for the link. I did not see the text of the signature in the value of the Body property of Redemption's SafeMailItem, as one might expect. Based on that test, also I assume that the signature would not appear in RDO.RDOMail.Body, .HTMLBody, .RTFBody either, but I didn't take the time to test those. I didn't see a ".Signature" property or equivalent in Outlook COM, Redemption Safe* items, or Redemption RDO objects. Am I missing something? In my install of Outlook 2003 (Word as Editor, HTML format by default) the signature line is getting added as long as I don't manipulate the SafeMailItem.Body property. Is that expected? "Sue Mosher [MVP-Outlook]" wrote in message ... It certainly is possible to add a signature to an email message. If Word is the editor, it's also easy to remove it, because it's exposed as a Bookmark object. See http://www.outlookcode.com/codedetail.aspx?id=615. If Word is not the email editor, the signature is not distinguished in any way from the rest of the text. "Jeff" wrote in message oups.com... Can someone confirm that the Outlook 2003 COM object model does not provide a way to programmatically get, modify, or remove the signature line of an email? Furthermore, it doesn't look like Redemption RDO supports manipulating the signature line either (http://www.google.com/search?q=signature +site%3Ahttp%3A%2F%2Fwww.dimastr.com%2Fredemption %2F&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en- US ![]() I've noticed that a SafeMailItem will contain the signature line as long as I don't modify the Body property. Has anyone else noticed that? |
#5
|
|||
|
|||
![]()
You've provided some great ideas on how to work w/ the signature, and
I appreciate them. I'm just trying to focus in on what the Outlook COM object model alone provides. For a new email, if setting MailItem.Body erases the signature line of an email, then one would hope that getting MailItem.Body prior to setting it would retrieve the signature line of an email. It'd be nice to be able to do something like this: pseudocode snippet: //create a new mail item MailItem m = folder.Item.Add(OlItemType.olMailItem); //store off the signature line (if the user has the option on): String sig = m.Body; //set Body to be my email content plus whatever the signature line is m.Body = "my email content" + sig; Contrary to how I'd like MailItem.Body to work, getting it prior to setting it returns nothing (even if there is a signature line), and setting it to something removes the signature line. I see no way to set the Body of the email to my email content while at the same time maintaining whatever signature line the user specified to appear in new emails by default. Thanks for your patience. jb |
#6
|
|||
|
|||
![]()
one would hope that getting MailItem.Body prior to
setting it would retrieve the signature line of an email. It does, if (a) the user has an automatic signature set up and (b) you call MailItem.Display first. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Jeff" wrote in message ups.com... You've provided some great ideas on how to work w/ the signature, and I appreciate them. I'm just trying to focus in on what the Outlook COM object model alone provides. For a new email, if setting MailItem.Body erases the signature line of an email, then one would hope that getting MailItem.Body prior to setting it would retrieve the signature line of an email. It'd be nice to be able to do something like this: pseudocode snippet: //create a new mail item MailItem m = folder.Item.Add(OlItemType.olMailItem); //store off the signature line (if the user has the option on): String sig = m.Body; //set Body to be my email content plus whatever the signature line is m.Body = "my email content" + sig; Contrary to how I'd like MailItem.Body to work, getting it prior to setting it returns nothing (even if there is a signature line), and setting it to something removes the signature line. I see no way to set the Body of the email to my email content while at the same time maintaining whatever signature line the user specified to appear in new emails by default. |
#7
|
|||
|
|||
![]()
The signature is also inserted if you touch the MailItem.GetInspector
property for the brand new messages with unmodified body. You do not need to actually display the message. This is probably the easiest way to insert the signature if you do not want to display the item first. Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Sue Mosher [MVP-Outlook]" wrote in message ... one would hope that getting MailItem.Body prior to setting it would retrieve the signature line of an email. It does, if (a) the user has an automatic signature set up and (b) you call MailItem.Display first. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Jeff" wrote in message ups.com... You've provided some great ideas on how to work w/ the signature, and I appreciate them. I'm just trying to focus in on what the Outlook COM object model alone provides. For a new email, if setting MailItem.Body erases the signature line of an email, then one would hope that getting MailItem.Body prior to setting it would retrieve the signature line of an email. It'd be nice to be able to do something like this: pseudocode snippet: //create a new mail item MailItem m = folder.Item.Add(OlItemType.olMailItem); //store off the signature line (if the user has the option on): String sig = m.Body; //set Body to be my email content plus whatever the signature line is m.Body = "my email content" + sig; Contrary to how I'd like MailItem.Body to work, getting it prior to setting it returns nothing (even if there is a signature line), and setting it to something removes the signature line. I see no way to set the Body of the email to my email content while at the same time maintaining whatever signature line the user specified to appear in new emails by default. |
#8
|
|||
|
|||
![]()
Good to know. Thanks!
-- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Dmitry Streblechenko" wrote in message ... The signature is also inserted if you touch the MailItem.GetInspector property for the brand new messages with unmodified body. You do not need to actually display the message. This is probably the easiest way to insert the signature if you do not want to display the item first. Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Sue Mosher [MVP-Outlook]" wrote in message ... one would hope that getting MailItem.Body prior to setting it would retrieve the signature line of an email. It does, if (a) the user has an automatic signature set up and (b) you call MailItem.Display first. "Jeff" wrote in message ups.com... You've provided some great ideas on how to work w/ the signature, and I appreciate them. I'm just trying to focus in on what the Outlook COM object model alone provides. For a new email, if setting MailItem.Body erases the signature line of an email, then one would hope that getting MailItem.Body prior to setting it would retrieve the signature line of an email. It'd be nice to be able to do something like this: pseudocode snippet: //create a new mail item MailItem m = folder.Item.Add(OlItemType.olMailItem); //store off the signature line (if the user has the option on): String sig = m.Body; //set Body to be my email content plus whatever the signature line is m.Body = "my email content" + sig; Contrary to how I'd like MailItem.Body to work, getting it prior to setting it returns nothing (even if there is a signature line), and setting it to something removes the signature line. I see no way to set the Body of the email to my email content while at the same time maintaining whatever signature line the user specified to appear in new emails by default. |
#9
|
|||
|
|||
![]()
Hi Dmitry,
Can you please explain in detail how to touch MailItem.GetInspector property? Regards, Gunjan Dmitry Streblechenko wrote: The signature is also inserted if you touch the MailItem. 24-Oct-07 The signature is also inserted if you touch the MailItem.GetInspector property for the brand new messages with unmodified body. You do not need to actually display the message. This is probably the easiest way to insert the signature if you do not want to display the item first. Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Sue Mosher [MVP-Outlook]" wrote in message ... It does, if (a) the user has an automatic signature set up and (b) you call MailItem.Display first. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Jeff" wrote in message ups.com... Previous Posts In This Thread: On Wednesday, October 24, 2007 11:27 AM Jeff wrote: Email signature using Outlook COM object model Can someone confirm that the Outlook 2003 COM object model does not provide a way to programmatically get, modify, or remove the signature line of an email? Furthermore, it doesn't look like Redemption RDO supports manipulating the signature line either (http://www.google.com/search?q=signature +site%3Ahttp%3A%2F%2Fwww.dimastr.com%2Fredemption %2F&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en- US ![]() I've noticed that a SafeMailItem will contain the signature line as long as I don't modify the Body property. Has anyone else noticed that? Thanks, Jeff On Wednesday, October 24, 2007 11:31 AM Sue Mosher [MVP-Outlook] wrote: It certainly is possible to add a signature to an email message. It certainly is possible to add a signature to an email message. If Word = is the editor, it's also easy to remove it, because it's exposed as a = Bookmark object. See = http://www.outlookcode.com/codedetail.aspx?id=3D615. If Word is not the = email editor, the signature is not distinguished in any way from the = rest of the text.=20 --=20 Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=3D54=20 "Jeff" wrote in message = oups.com... On Wednesday, October 24, 2007 12:03 PM Jeff wrote: Thanks for the link. Thanks for the link. I did not see the text of the signature in the value of the Body property of Redemption's SafeMailItem, as one might expect. Based on that test, also I assume that the signature would not appear in RDO.RDOMail.Body, .HTMLBody, .RTFBody either, but I didn't take the time to test those. I didn't see a ".Signature" property or equivalent in Outlook COM, Redemption Safe* items, or Redemption RDO objects. Am I missing something? In my install of Outlook 2003 (Word as Editor, HTML format by default) the signature line is getting added as long as I don't manipulate the SafeMailItem.Body property. Is that expected? Thanks, Jeff On Wednesday, October 24, 2007 1:22 PM Sue Mosher [MVP-Outlook] wrote: There is no Signature property. There is no Signature property. The operations I describe do not depend = on there being one.=20 It might help if you showed some code. Without that, we have no way of = knowing in what order you're performing operations, etc. If you = overwrite the Body property, for example, any signature that already = exists is going to be replaced by your new Body text.=20 --=20 Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=3D54=20 "Jeff" wrote in message = ups.com... "Sue Mosher [MVP-Outlook]" wrote in message = ... It certainly is possible to add a signature to an email message. If Word = is the editor, it's also easy to remove it, because it's exposed as a = Bookmark object. See = http://www.outlookcode.com/codedetail.aspx?id=3D615. If Word is not the = email editor, the signature is not distinguished in any way from the = rest of the text.=20 "Jeff" wrote in message = oups.com... On Wednesday, October 24, 2007 2:46 PM Jeff wrote: You've provided some great ideas on how to work w/ the signature, andI You've provided some great ideas on how to work w/ the signature, and I appreciate them. I'm just trying to focus in on what the Outlook COM object model alone provides. For a new email, if setting MailItem.Body erases the signature line of an email, then one would hope that getting MailItem.Body prior to setting it would retrieve the signature line of an email. It'd be nice to be able to do something like this: pseudocode snippet: //create a new mail item MailItem m = folder.Item.Add(OlItemType.olMailItem); //store off the signature line (if the user has the option on): String sig = m.Body; //set Body to be my email content plus whatever the signature line is m.Body = "my email content" + sig; Contrary to how I'd like MailItem.Body to work, getting it prior to setting it returns nothing (even if there is a signature line), and setting it to something removes the signature line. I see no way to set the Body of the email to my email content while at the same time maintaining whatever signature line the user specified to appear in new emails by default. Thanks for your patience. jb On Wednesday, October 24, 2007 5:09 PM Sue Mosher [MVP-Outlook] wrote: It does, if (a) the user has an automatic signature set up and (b) you =call It does, if (a) the user has an automatic signature set up and (b) you = call MailItem.Display first.=20 --=20 Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=3D54=20 "Jeff" wrote in message = ups.com... On Wednesday, October 24, 2007 6:24 PM Dmitry Streblechenko wrote: The signature is also inserted if you touch the MailItem. The signature is also inserted if you touch the MailItem.GetInspector property for the brand new messages with unmodified body. You do not need to actually display the message. This is probably the easiest way to insert the signature if you do not want to display the item first. Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Sue Mosher [MVP-Outlook]" wrote in message ... It does, if (a) the user has an automatic signature set up and (b) you call MailItem.Display first. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Jeff" wrote in message ups.com... On Thursday, October 25, 2007 7:57 AM Sue Mosher [MVP-Outlook] wrote: Good to know. Thanks! Good to know. Thanks!=20 --=20 Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=3D54=20 "Dmitry Streblechenko" wrote in message = ... need to=20 insert the=20 call=20 COM of Submitted via EggHeadCafe - Software Developer Portal of Choice WPF Report Engine, Part 4 http://www.eggheadcafe.com/tutorials...ne-part-4.aspx |
#10
|
|||
|
|||
![]()
set DummyVariable = MailItem.GetInspector
is all it takes -- Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool - Gunjan wrote in message ... Hi Dmitry, Can you please explain in detail how to touch MailItem.GetInspector property? Regards, Gunjan Dmitry Streblechenko wrote: The signature is also inserted if you touch the MailItem. 24-Oct-07 The signature is also inserted if you touch the MailItem.GetInspector property for the brand new messages with unmodified body. You do not need to actually display the message. This is probably the easiest way to insert the signature if you do not want to display the item first. Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Sue Mosher [MVP-Outlook]" wrote in message ... It does, if (a) the user has an automatic signature set up and (b) you call MailItem.Display first. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Jeff" wrote in message ups.com... Previous Posts In This Thread: On Wednesday, October 24, 2007 11:27 AM Jeff wrote: Email signature using Outlook COM object model Can someone confirm that the Outlook 2003 COM object model does not provide a way to programmatically get, modify, or remove the signature line of an email? Furthermore, it doesn't look like Redemption RDO supports manipulating the signature line either (http://www.google.com/search?q=signature +site%3Ahttp%3A%2F%2Fwww.dimastr.com%2Fredemption %2F&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en- US ![]() I've noticed that a SafeMailItem will contain the signature line as long as I don't modify the Body property. Has anyone else noticed that? Thanks, Jeff On Wednesday, October 24, 2007 11:31 AM Sue Mosher [MVP-Outlook] wrote: It certainly is possible to add a signature to an email message. It certainly is possible to add a signature to an email message. If Word = is the editor, it's also easy to remove it, because it's exposed as a = Bookmark object. See = http://www.outlookcode.com/codedetail.aspx?id=3D615. If Word is not the = email editor, the signature is not distinguished in any way from the = rest of the text.=20 --=20 Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=3D54=20 "Jeff" wrote in message = oups.com... On Wednesday, October 24, 2007 12:03 PM Jeff wrote: Thanks for the link. Thanks for the link. I did not see the text of the signature in the value of the Body property of Redemption's SafeMailItem, as one might expect. Based on that test, also I assume that the signature would not appear in RDO.RDOMail.Body, .HTMLBody, .RTFBody either, but I didn't take the time to test those. I didn't see a ".Signature" property or equivalent in Outlook COM, Redemption Safe* items, or Redemption RDO objects. Am I missing something? In my install of Outlook 2003 (Word as Editor, HTML format by default) the signature line is getting added as long as I don't manipulate the SafeMailItem.Body property. Is that expected? Thanks, Jeff On Wednesday, October 24, 2007 1:22 PM Sue Mosher [MVP-Outlook] wrote: There is no Signature property. There is no Signature property. The operations I describe do not depend = on there being one.=20 It might help if you showed some code. Without that, we have no way of = knowing in what order you're performing operations, etc. If you = overwrite the Body property, for example, any signature that already = exists is going to be replaced by your new Body text.=20 --=20 Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=3D54=20 "Jeff" wrote in message = ups.com... "Sue Mosher [MVP-Outlook]" wrote in message = ... It certainly is possible to add a signature to an email message. If Word = is the editor, it's also easy to remove it, because it's exposed as a = Bookmark object. See = http://www.outlookcode.com/codedetail.aspx?id=3D615. If Word is not the = email editor, the signature is not distinguished in any way from the = rest of the text.=20 "Jeff" wrote in message = oups.com... On Wednesday, October 24, 2007 2:46 PM Jeff wrote: You've provided some great ideas on how to work w/ the signature, andI You've provided some great ideas on how to work w/ the signature, and I appreciate them. I'm just trying to focus in on what the Outlook COM object model alone provides. For a new email, if setting MailItem.Body erases the signature line of an email, then one would hope that getting MailItem.Body prior to setting it would retrieve the signature line of an email. It'd be nice to be able to do something like this: pseudocode snippet: //create a new mail item MailItem m = folder.Item.Add(OlItemType.olMailItem); //store off the signature line (if the user has the option on): String sig = m.Body; //set Body to be my email content plus whatever the signature line is m.Body = "my email content" + sig; Contrary to how I'd like MailItem.Body to work, getting it prior to setting it returns nothing (even if there is a signature line), and setting it to something removes the signature line. I see no way to set the Body of the email to my email content while at the same time maintaining whatever signature line the user specified to appear in new emails by default. Thanks for your patience. jb On Wednesday, October 24, 2007 5:09 PM Sue Mosher [MVP-Outlook] wrote: It does, if (a) the user has an automatic signature set up and (b) you =call It does, if (a) the user has an automatic signature set up and (b) you = call MailItem.Display first.=20 --=20 Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=3D54=20 "Jeff" wrote in message = ups.com... On Wednesday, October 24, 2007 6:24 PM Dmitry Streblechenko wrote: The signature is also inserted if you touch the MailItem. The signature is also inserted if you touch the MailItem.GetInspector property for the brand new messages with unmodified body. You do not need to actually display the message. This is probably the easiest way to insert the signature if you do not want to display the item first. Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Sue Mosher [MVP-Outlook]" wrote in message ... It does, if (a) the user has an automatic signature set up and (b) you call MailItem.Display first. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Jeff" wrote in message ups.com... On Thursday, October 25, 2007 7:57 AM Sue Mosher [MVP-Outlook] wrote: Good to know. Thanks! Good to know. Thanks!=20 --=20 Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=3D54=20 "Dmitry Streblechenko" wrote in message = ... need to=20 insert the=20 call=20 COM of Submitted via EggHeadCafe - Software Developer Portal of Choice WPF Report Engine, Part 4 http://www.eggheadcafe.com/tutorials...ne-part-4.aspx |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Why does the Address property of the Recipient object in the Outlook object model look funny? | Omatase | Outlook - General Queries | 2 | July 13th 07 10:09 PM |
Outlook Object Model Threading | MON205 | Outlook - General Queries | 8 | May 6th 07 05:37 PM |
Outlook Object Model Threading | MON205 | Add-ins for Outlook | 8 | May 6th 07 05:37 PM |
Outlook object model guard | Mark Priem | Outlook and VBA | 7 | January 3rd 07 07:41 PM |
How to redistribute Outlook Object Model? | papachina | Outlook and VBA | 5 | September 11th 06 08:14 PM |