PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook VBA Programming Use VBS to insert signature in an e-mail

Reply

Use VBS to insert signature in an e-mail

 
Thread Tools Rate Thread
Old 13-02-2004, 06:49 PM   #1
Rim Dur
Guest
 
Posts: n/a
Default Use VBS to insert signature in an e-mail


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
  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

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