PC Review
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
Use VBS to insert signature in an e-mail
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
Use VBS to insert signature in an e-mail
![]() |
Use VBS to insert signature in an e-mail |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Hello, can anyone please help me how to insert a text file into an
e-mail. This code have to work for different people. The signature is located here. C:\Documents and Settings\%USER%\Application Data\Microsoft\Signatures\Test.rtf How do I get the signature into the mailbody? This is the code I use now. Of course I can write the code directly into the omail.body but I do not want to edit the code for 15 people if the phone number changes. Sub ForwardItem_MyTest() Dim oExplorer As Outlook.Explorer Dim omail As Outlook.MailItem Dim oOldMail As Outlook.MailItem Set oExplorer = Application.ActiveExplorer If oExplorer.Selection.Item(1).Class = olMail Then Set oOldMail = oExplorer.Selection.Item(1) Set omail = oOldMail.Forward Set fso = CreateObject("Scripting.FileSystemObject") omail.SentOnBehalfOfName = "office1" omail.To = oOldMail.SenderName & ";" & "division2" omail.CC = "myboss" omail.Recipients.Item(1).Resolve If omail.Recipients.Item(1).Resolved Then omail.Body = "Here is my fixed text" & omail.Body omail.Display Else MsgBox "Could not resolve " & omail.Recipients.Item(1).Name End If Else MsgBox "Not a mail item" End If End Sub Have a nice ......... Jon |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

