Message Text is Blank

G

Guest

I am using VBA code in MS access to open an Outlook mail message and populate
the To, Subject, and message text (email body) fields. It works fine on my
workstation, but the message body comed up blank when another workstation
uses the database, runs the code, etc. The To and Subject fields populate,
but the message text is blank. No error message comes up, and the user can
type text and send the email fine.

Is there a setting in Outlook that I need to change to allow the message
text to populate? Is it blocking an unsafe exporession by chance? Has
anyone had this problem before?

Thanks,

DEI
 
G

Guest

What versions of Outlook?
Are you setting Body or HTMLBody?
Can you show your code please?
 
G

Guest

Thanks for the reply. I do not know what version of Outlook it is, but it
might be older than 2003, which is on my machine, but I doubt it.

I am using the SendObject Method in a module in MS Access. The code is
below. I would be OK with using some automation code that opens the Outlook
app, creates a message, etc., but I tried to use an example taken from
Microsoft.com for Access 97 but could not get that to work. Maybe that is a
better solution. I am trying to create a plain test message via the argument
below.

I am using Access 2003. Does it have something to do with the MS Outlook
Security update. This is very frustrating.

Thanks again.

Dim em as String
em = Forms!frmREQUESTS.EMAIL

DoCmd.SendObject , , acFormatTXT, em, , , "Catering Request Confirmation #" &
Forms!frmREQUESTS.REQCON, _
"Nutrition Services has received your recent catering order for:" & vbCr &
vbCr & _
"Date: " & Forms!frmREQUESTS.EVENTDATE & vbCr & _
"Time: " & Forms!frmREQUESTS.BEGX & vbCr & _
"Location: " & Forms!frmREQUESTS.BLDGRM & vbCr & _
"Number Attending: " & Forms!frmREQUESTS.NUMGUESTS & vbCr & _
"Confirmation Number: " & Forms!frmREQUESTS.REQCON & vbCr & _
"Requested by: " & Forms!frmREQUESTS.LNAME & ", " & Forms frmREQUESTS.FNAME
 
G

Guest

Outlook's security dialog will only apply if you set the last argument in
SendObject to True, otherwise the e-mail is only displayed and must be
manually sent.

The only thing I can guess at is that maybe that other PC does not have
access to that table?? Try building the body text into a String variable
first, and use Debug.Assert, watches or evaluation expressions to make sure
that there is valid text in that variable before calling SendObject. I don't
see this being an Outlook issue at this point.

--
Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/
 
G

Guest

Thanks for clarifying re: Outlook's security dialog, but I think you meant to
say that it applies when the last argument is set to False; that sends the
message without opening it for editing (it is counterintuitive), but the
default is True.

I will try to work with it. When I first put the Access front-end on the
user's machine, I was prompted with messages about whether Access should
block unsafe expressions. The user had never used Access on their machine
before. I wonder if I need to reset that setting.

THanks.

DEI
 

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