Outlook automation issue

  • Thread starter Thread starter musicmaker58
  • Start date Start date
M

musicmaker58

I have used automation to create emails and send via access, however the
signature that i have set up in outlook does not appear via access
automation, whilst it does if a new message is created in outllook.
 
Check to see if your code uses early binding. If it does, you'll need to set
a reference to Outlook from Access.
 
thank you for your help, I have my code as follows

Public gappOutlook As Outlook.Application
Private mItm As Outlook.MailItem

Private Sub btnEmail_Click()
On Error GoTo ErrorHandler
Dim fBlnOK As Boolean
If IsNothing(Me.ComEmail) Then
Exit Sub
End If

Dim strTxtDearName As String
strTxtDearName = Forms.frmPriceChangeNotificationEquipment.Form.ContactDear
Set gappOutlook = GetObject(, Outlook.Application)
Set mItm = gappOutlook.CreateItem(olMailItem)
With mItm
.To = Me.ComEmail
.Subject = Me.PCTitle
.Body = "Dear " & strTxtDearName & vbCrLf _
& vbCrLf & Me.PCText1 _
& vbCrLf & vbCrLf & Me.PriceString _
& vbCrLf & vbCrLf & Me.PCText2 _
& vbCrLf & vbCrLf & Me.PCExitLine _
& vbCrLf & vbCrLf & FnGSConfNotice()
.Display
End With
 
Yes that's Early bound, set the reference to whichever version of Outlook
that you use.
 
I have set the reference as suggested and the signature appears fine untill
the body text which replaces my signature, if i omit the body text the
signature is fine.
 
Back
Top