Outlook automation issue

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.
 
A

Arvin Meyer MVP

Check to see if your code uses early binding. If it does, you'll need to set
a reference to Outlook from Access.
 
M

musicmaker58

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
 
A

Arvin Meyer MVP

Yes that's Early bound, set the reference to whichever version of Outlook
that you use.
 
M

musicmaker58

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.
 

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