Issue with code SendObject 2

P

Peter

Hi all, i appologize for my previous empty posting...below i have alos
included further details related to my issue:

In the “on click event of a command button in a form i shave this code
Private Sub Command36_Click()
On Error GoTo Error_Handler

DoCmd.SendObject

Dim varTo As Variant
Dim varCC As Variant
Dim stSubject As String

Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem
Dim errLoop As Error

Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)

With objEmail
..To = Me.[Text28]
..CC = Me.[Text30]
..Subject = Me.[Text34]

End With

Exit_Here:
Set objOutlook = Nothing
Exit Sub

Error_Handler:
MsgBox Err & ": " & Err.Description
Resume Exit_Here

End Sub

The purpose is to open an email and populate the To / CC and Subjectline...
Something is wrong because the email opens..but does not populate the fields..
Thanks!
 

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