![]() |
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
|
|||
|
|||
![]()
I have attached the following code to a button on the quick access bar in Outlook. It does all I want except that "body text" erases my default signature. Is there some additional code I could include that would complete the email with my default signature? The default signature uses various fonts sizes and colours. Thanks for any help.
Sub inspector() Dim myOlApp As New Outlook.Application Dim myItem As Object Dim myAttachments As Outlook.Attachments Set myItem = myOlApp.ActiveInspector.currentitem Set myAttachments = myItem.Attachments myItem.Subject = "Status Report" myItem.Body = "body text" myAttachments.Add "C:\Documents and settings\etc myItem.Display End Sub |
Ads |
#2
|
|||
|
|||
![]()
Call Display() before you add anything to the body. The signature is added
after the item is opened. If you want to have your addition before any signature then after you call Display() use code like this: myItem.Body = "body text" & myItem.Body -- 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 "steve sharpe" wrote in message ... I have attached the following code to a button on the quick access bar in Outlook. It does all I want except that "body text" erases my default signature. Is there some additional code I could include that would complete the email with my default signature? The default signature uses various fonts sizes and colours. Thanks for any help. Sub inspector() Dim myOlApp As New Outlook.Application Dim myItem As Object Dim myAttachments As Outlook.Attachments Set myItem = myOlApp.ActiveInspector.currentitem Set myAttachments = myItem.Attachments myItem.Subject = "Status Report" myItem.Body = "body text" myAttachments.Add "C:\Documents and settings\etc myItem.Display End Sub -- steve sharpe |
#3
|
|||
|
|||
![]()
Hi Ken
Thankyou for youir reply. What have I done wrong? I think I have altered my code as you suggested but it does not make any difference. Here's what I wrote... Would you be kind enough to point out my mistake? Sub InsertMySig() Dim myOlApp As New Outlook.Application Dim myItem As Object Dim myAttachments As Outlook.Attachments Set myItem = myOlApp.ActiveInspector.currentitem Set myAttachments = myItem.Attachments myItem.Subject = "Status Report" myItem.Display myItem.Body = "body text" & myItem.Body myAttachments.Add "C:\Documents and settings\etc" End Sub I look forward to hearing from you. Best wishes Steve Quote:
|
#4
|
|||
|
|||
![]()
I'm not sure. Let's see what happens first if you comment out the line
myItem.Body = "body text" & myItem.Body. Do you get the signature then? If so and the body format is HTML, then see if it helps to use this line instead: myItem.HTMLBody = "body text" & myItem.HTMLBody -- 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 "steve sharpe" wrote in message ... Hi Ken Thankyou for youir reply. What have I done wrong? I think I have altered my code as you suggested but it does not make any difference. Here's what I wrote... Would you be kind enough to point out my mistake? Sub InsertMySig() Dim myOlApp As New Outlook.Application Dim myItem As Object Dim myAttachments As Outlook.Attachments Set myItem = myOlApp.ActiveInspector.currentitem Set myAttachments = myItem.Attachments myItem.Subject = "Status Report" myItem.Display myItem.Body = "body text" & myItem.Body myAttachments.Add "C:\Documents and settings\etc" End Sub I look forward to hearing from you. Best wishes Steve |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Create macro to insert signature into email... | Fuel451 | Outlook and VBA | 8 | December 31st 09 03:26 PM |
Include Signature or V Card when performing email merge | V Burke | Outlook - Using Contacts | 1 | January 23rd 07 03:29 AM |
Include Signature or V Card when performing email merges | V Burke | Outlook - Using Contacts | 1 | January 15th 07 05:18 PM |
include link with signature | Curtis | Outlook - Using Contacts | 1 | May 3rd 06 02:45 AM |