A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Email body and signature help



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old July 25th 09, 12:56 AM posted to microsoft.public.outlook.program_vba
joave
external usenet poster
 
Posts: 6
Default Email body and signature help

Hi:

I am attempting to insert specific text into the body of an HTML message
using Word as the editor with VBA. However, when I change the body of the
message, my signature disappears. Can someone please tell me how to keep the
signature in the message while inserting additional text? I have tried
several different methods but none seem to work.

Here is my current code (with some failed attempts at the above goal):

Dim objOLApp As Outlook.Application
Dim NewMail As Outlook.MailItem
Set objOLApp = New Outlook.Application
Set NewMail = objOLApp.CreateItem(olMailItem)
NewMail.Display
NewMail.To = "CF Reports"
NewMail.Subject = "Report " & Date - 1
Dim Temp As String

Temp = "Hi Team, /br" & vbCrLf & vbCrLf & " Here is the latest Report.
Please let me know if you have any questions." & vbCrLf & vbCrLf & "Thank
you,"
Temp = Temp & vbCrLf & vbCrLf & "David " & NewMail.HTMLBody
NewMail.HTMLBody = Temp
'NewMail.Body = Temp

Thank you in advance,

Dave
Ads
  #2  
Old July 25th 09, 01:22 AM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP][_3_]
external usenet poster
 
Posts: 465
Default Email body and signature help

Call the message's Display method, get the HTMLBody (which will have the
signature at that point), and modify HTMLBody to include your new text. If
you know what the signature looks like, it may be easiest to use the
Replace() function to find the beginning of the signature and replace it
with your_new_text+beginning_of_signature.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"joave" wrote in message
...
Hi:

I am attempting to insert specific text into the body of an HTML message
using Word as the editor with VBA. However, when I change the body of the
message, my signature disappears. Can someone please tell me how to keep
the
signature in the message while inserting additional text? I have tried
several different methods but none seem to work.

Here is my current code (with some failed attempts at the above goal):

Dim objOLApp As Outlook.Application
Dim NewMail As Outlook.MailItem
Set objOLApp = New Outlook.Application
Set NewMail = objOLApp.CreateItem(olMailItem)
NewMail.Display
NewMail.To = "CF Reports"
NewMail.Subject = "Report " & Date - 1
Dim Temp As String

Temp = "Hi Team, /br" & vbCrLf & vbCrLf & " Here is the latest Report.
Please let me know if you have any questions." & vbCrLf & vbCrLf & "Thank
you,"
Temp = Temp & vbCrLf & vbCrLf & "David " & NewMail.HTMLBody
NewMail.HTMLBody = Temp
'NewMail.Body = Temp

Thank you in advance,

Dave



  #3  
Old July 25th 09, 09:38 PM posted to microsoft.public.outlook.program_vba
joave
external usenet poster
 
Posts: 6
Default Email body and signature help

Hi Sue,

Thank you for your reply. This is where I thought this would go (there are
never any magic answers LOL). I was hoping to be able to use the picture that
is in my signature without having to replace the entire body, but it looks
like that will be very difficult to do.

Thanks again,

Dave

"Sue Mosher [MVP]" wrote:

Call the message's Display method, get the HTMLBody (which will have the
signature at that point), and modify HTMLBody to include your new text. If
you know what the signature looks like, it may be easiest to use the
Replace() function to find the beginning of the signature and replace it
with your_new_text+beginning_of_signature.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"joave" wrote in message
...
Hi:

I am attempting to insert specific text into the body of an HTML message
using Word as the editor with VBA. However, when I change the body of the
message, my signature disappears. Can someone please tell me how to keep
the
signature in the message while inserting additional text? I have tried
several different methods but none seem to work.

Here is my current code (with some failed attempts at the above goal):

Dim objOLApp As Outlook.Application
Dim NewMail As Outlook.MailItem
Set objOLApp = New Outlook.Application
Set NewMail = objOLApp.CreateItem(olMailItem)
NewMail.Display
NewMail.To = "CF Reports"
NewMail.Subject = "Report " & Date - 1
Dim Temp As String

Temp = "Hi Team, /br" & vbCrLf & vbCrLf & " Here is the latest Report.
Please let me know if you have any questions." & vbCrLf & vbCrLf & "Thank
you,"
Temp = Temp & vbCrLf & vbCrLf & "David " & NewMail.HTMLBody
NewMail.HTMLBody = Temp
'NewMail.Body = Temp

Thank you in advance,

Dave




  #4  
Old December 28th 09, 07:03 AM posted to microsoft.public.outlook.program_vba
Curt
external usenet poster
 
Posts: 19
Default Email body and signature help

Can you direct me as to getting a picture into a signature macro in Outlook
2000 useing XP. Have done macros in excel but outlook is not same. Copying
excel does not work. Am not sure where to start. Macro would then contain
signature & picture when inserting into outgoing mail
Thanks

"Sue Mosher [MVP]" wrote:

Call the message's Display method, get the HTMLBody (which will have the
signature at that point), and modify HTMLBody to include your new text. If
you know what the signature looks like, it may be easiest to use the
Replace() function to find the beginning of the signature and replace it
with your_new_text+beginning_of_signature.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"joave" wrote in message
...
Hi:

I am attempting to insert specific text into the body of an HTML message
using Word as the editor with VBA. However, when I change the body of the
message, my signature disappears. Can someone please tell me how to keep
the
signature in the message while inserting additional text? I have tried
several different methods but none seem to work.

Here is my current code (with some failed attempts at the above goal):

Dim objOLApp As Outlook.Application
Dim NewMail As Outlook.MailItem
Set objOLApp = New Outlook.Application
Set NewMail = objOLApp.CreateItem(olMailItem)
NewMail.Display
NewMail.To = "CF Reports"
NewMail.Subject = "Report " & Date - 1
Dim Temp As String

Temp = "Hi Team, /br" & vbCrLf & vbCrLf & " Here is the latest Report.
Please let me know if you have any questions." & vbCrLf & vbCrLf & "Thank
you,"
Temp = Temp & vbCrLf & vbCrLf & "David " & NewMail.HTMLBody
NewMail.HTMLBody = Temp
'NewMail.Body = Temp

Thank you in advance,

Dave




  #5  
Old December 28th 09, 12:25 PM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Email body and signature help



If you want to send the image with the email, you need to embed it. This
example demonstrartes how to do that:
http://www.vboffice.net/sample.html?...9&cmd=showitem

--
Best regards
Michael Bauer - MVP Outlook
Manage and share your categories:
http://www.vboffice.net/product.html?pub=6&lang=en


Am Sun, 27 Dec 2009 22:03:01 -0800 schrieb Curt:

Can you direct me as to getting a picture into a signature macro in

Outlook
2000 useing XP. Have done macros in excel but outlook is not same. Copying
excel does not work. Am not sure where to start. Macro would then contain
signature & picture when inserting into outgoing mail
Thanks

"Sue Mosher [MVP]" wrote:

Call the message's Display method, get the HTMLBody (which will have the
signature at that point), and modify HTMLBody to include your new text.

If
you know what the signature looks like, it may be easiest to use the
Replace() function to find the beginning of the signature and replace it
with your_new_text+beginning_of_signature.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"joave" wrote in message
...
Hi:

I am attempting to insert specific text into the body of an HTML

message
using Word as the editor with VBA. However, when I change the body of

the
message, my signature disappears. Can someone please tell me how to keep
the
signature in the message while inserting additional text? I have tried
several different methods but none seem to work.

Here is my current code (with some failed attempts at the above goal):

Dim objOLApp As Outlook.Application
Dim NewMail As Outlook.MailItem
Set objOLApp = New Outlook.Application
Set NewMail = objOLApp.CreateItem(olMailItem)
NewMail.Display
NewMail.To = "CF Reports"
NewMail.Subject = "Report " & Date - 1
Dim Temp As String

Temp = "Hi Team, /br" & vbCrLf & vbCrLf & " Here is the latest

Report.
Please let me know if you have any questions." & vbCrLf & vbCrLf &

"Thank
you,"
Temp = Temp & vbCrLf & vbCrLf & "David " & NewMail.HTMLBody
NewMail.HTMLBody = Temp
'NewMail.Body = Temp

Thank you in advance,

Dave




 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
New Email Message in Outlook 2007 starts in Body of email not in To:field [email protected] Outlook - General Queries 3 March 28th 08 02:23 AM
Adding af signature file at the end of the body text kurt Outlook and VBA 3 February 5th 08 06:03 PM
font color in signature and email body changes Ghostrider1965 Outlook - General Queries 0 December 4th 07 05:07 AM
Extra lines in the body when FW or RE...NOT in the signature KimCo Outlook - General Queries 0 May 10th 07 05:27 PM
Dragging an email to the Calendar drops the email body text yan Outlook - Calandaring 2 February 1st 06 02:23 AM


All times are GMT +1. The time now is 07:51 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.