Link to home
Start Free TrialLog in
Avatar of richardhubbard
richardhubbardFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Email created in MS Outlook using MS Access has blank Body

I am using MS Access to send emails via Outlook.
I have Access 2002 and Outlook 2002 running in XP
I have used the following code to send emails without any problems from numerous computers.
But for one computer everything works, ie the email is created, but the Body section of the email is blank. I have checked the contents of the string via the msgbox and the information exists to insert into the body of the email, but when I open it in the Outlook Outbox, the text is just not there, the body of the message is blank.

  Set mItem = mOutlookApp.CreateItem(olMailItem)
    mItem.Recipients.Add strRecip
    mItem.Subject = strsubject
    msgbox strmsg   'used to check strmsg has content
    mItem.Body = strmsg
    mItem.SentOnBehalfOfName = strsender
    mItem.Save
    mItem.Send

As it is not a problem I have experienced on any other machine it is difficult replicate it when I am working at the office to develop the programme.
Any suggestions of what the bug might be.

Richard
ASKER CERTIFIED SOLUTION
Avatar of slink9
slink9

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of richardhubbard

ASKER

I passed on the instructions to run this and I will let you know the outcome.
Many thanks.

Richard
Detect and repair has been run, but it has the same problem.
Do you have any other suggestions I can try??
Just checked with the user of the programme again, and it was another problem he was referring to.
The email aspect is now working, so Detect and Repair seemed to have done the trick.
Many thanks and points well spent.

Richard
Avatar of slink9
slink9

Why a B?
I guess I have not understood the grading system.
Please tell me if my thinking is wrong.
In the past I have asked a question where the expert clearly spent some time researching and testing the answer.
You were able to answer my question, for which I am very grateful, but it was from existing knowledge of the program, knowledge I did not have but do now.

I would give the first expert the highest grade because of the time clearly spend finding the right answer for me. If I gave the same grade here would it not devalue the grading system?

Sorry if I have offended, I did not intend to, just wanted to reflect what I thought was the appropriate response.

If I have got this wrong and I am able to, I will change the response.


That thinking is somewhat amiss.  I did not get the knowledge that emailing from other programs works by accident.  I was not born with the ability to review the code you posted.  I also did not magically "know" Outlook, but have to use it myself and experiment with many procedures to gain more and more knowledge on it.
Yes.  That was a simple solution, but it still deserved an A.  That is sort of like basing the grade on the amount of time taken to answer.  The solution may have come 30 seconds after the question, but it could also have resulted from months of research which ended with one or two highly detailed links.
Sorry - is there anything you want me to do?
No problem.  Just explaining the situation.  There are some who never give good grades.  They don't get much help after a few times of that.  We all come in and make newbie mistakes.  No biggee.