Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

No email signature with sendobject

Status
Not open for further replies.

TommyF

Technical User
Oct 28, 2001
104


I am using the sendobject command to send an email with a report attached.

DoCmd.SendObject acSendReport, "quoteprint", acFormatHTML, Me.Text29, , , Me.Text31

It all works fine but the email does not have my personal email signature attached to it.

I am using Microsoft outlook and the only way I can get the signature is to change the email to html format and insert it manually which sort of defeats the object. I have also tried it in outlook express and I get the same result.

Is there anyway around this?
 
Better use this function:

Function fctnOutlook(Optional FromAddr, Optional Addr, Optional CC, Optional BCC, _
Optional Subject, Optional MessageText, Optional AttachmentPath, Optional Vote As String = vbNullString, _
Optional Urgency As Byte = 1, Optional EditMessage As Boolean = True)

' Code sample from Accessory
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim objOutlookAttach As Outlook.Attachment
Dim TestEmail As Variant, i As Integer
Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)

With objOutlookMsg

If Not IsMissing(FromAddr) Then
.SentOnBehalfOfName = FromAddr
End If

If Not IsMissing(Addr) Then
TestEmail = Split(Addr, ";")
For i = 0 To UBound(TestEmail)
Set objOutlookRecip = .Recipients.Add(TestEmail(i))
Next i
objOutlookRecip.type = olTo
End If

If Not IsMissing(CC) Then
TestEmail = Split(CC, ";")
For i = 0 To UBound(TestEmail)
Set objOutlookRecip = .Recipients.Add(TestEmail(i))
Next i
objOutlookRecip.type = olCC
End If

If Not IsMissing(BCC) Then
Set objOutlookRecip = .Recipients.Add(BCC)
objOutlookRecip.type = olBCC
End If

If Not IsMissing(Subject) Then
.Subject = Subject
End If

If Not IsMissing(MessageText) Then
.Body = MessageText
End If

If Not IsMissing(AttachmentPath) Then
Set objOutlookAttach = .Attachments.Add(AttachmentPath)
End If

If IsNull(Vote) = False Then
.VotingOptions = Vote
End If

Select Case Urgency
Case 2
.Importance = olImportanceHigh
Case 0
.Importance = olImportanceLow
Case Else
.Importance = olImportanceNormal
End Select

For Each objOutlookRecip In .Recipients
objOutlookRecip.Resolve
Next
If EditMessage Then
.Display
Else
.Save
.Send
End If

End With
Set objOutlook = Nothing

End Function
 
thanks for your reply. I do use a very similar code already in another database and I have just tried it with that and it still does not work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top