Outlook signatures

B

Brendanpeek

Hello All

I have the following code and i want to add one of my saved Signatures
(which are in outlook) to it, is this possible?

Private Sub Form_Timer()

Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim objOutlookAttach As Outlook.Attachment
Dim FilePathStrg As String
Dim FileNameStrg As String

If DCount([Allocated To], [queries]![Cal Due Email]) > 0 Then

FilePathStrg = "C:\Documents and Settings\Brendan.Mills\Desktop\Equipment
DB\"
FileNameStrg = "Items due for calibration" & ".rtf"

If DoesFileExist(FilePathStrg & FileNameStrg) = True Then
Kill FilePathStrg & FileNameStrg
Else
End If

DoCmd.OutputTo acOutputReport, "Cal Due Email", acFormatRTF, FilePathStrg
& FileNameStrg, False

' Create the Outlook session.
Set objOutlook = CreateObject("Outlook.Application")
' Create the message.
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
' Add the To recipient(s) to the message. Substitute
' your names here.
Set objOutlookRecip = .Recipients.Add("Jeremy Ashford")
objOutlookRecip.Type = olTo
' Add the CC recipient(s) to the message.
Set objOutlookRecip = .Recipients.Add("Matthew Horlock")
objOutlookRecip.Type = olCC
Set objOutlookRecip = .Recipients.Add("Brendan Mills")
objOutlookRecip.Type = olBCC
' Set the Subject, Body, and Importance of the message.
.Subject = "Items Due For Calibration"
.Body = "Please find attached a rich text file with all the items that
urgently require collecting from the person they are allocated to. If any of
the information in this document do not reflect what is known to be true
please inform Matthew Horlock via Email ASAP -
(e-mail address removed)" & _
" " & _
"STREAM Database for Test Equipment" & _
"This Email and attachment was generated by STREAM" & _
"Any questions about STREAM please Email -
(e-mail address removed)" & vbCrLf & vbCrLf
.Importance = olImportanceHigh 'High importance
' Add attachments to the message.
If IsMissing(AttachmentPath) Then
Set objOutlookAttach = .Attachments.Add("C:\Documents and
Settings\Brendan.Mills\Desktop\Equipment DB\Items due for calibration.rtf")
End If
' Resolve each Recipient's name.
For Each objOutlookRecip In .Recipients
If Not objOutlookRecip.Resolve Then
objOutlookMsg.Display
End If
Next
.Send
End With
Set objOutlookMsg = Nothing
Set objOutlook = Nothing
Set objOutlookRecip = Nothing
Set objOutlookAttach = Nothing

Else: Exit Sub
End If
End Sub

Thank you for your time.
 
N

Nikkel

Hi,

you can read the .txt file of your signature and include this string to your
message.

bye

niki
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top