email automation

U

Uzay

Hi @all,

i tried to create an email from an third party tool which supports vba and
automation. So i used the createobject() function to get a reference to
Outllok 2003 and that worked properly. But when i try to create an mailitem,
i get an
"application-defined or object defined error" when i set the subject and the
body of the email:
The code is the following:
set myApp = createobject("Outlook.Application")
set myMail = myApp.createitem(0)
myMail.recipients.add "<address>"
'now the problems occur with following lines
myMail.subject = "Hello"
myMail.body = "test mail" 'this causes the same error as the line above
myMail.Display

Any ideas, what can cause this error?
 

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