PDA

Click to See Complete Forum and Search --> : How can I send emails from Word2000 using visual basic?


Marste
Jan 24th, 2000, 09:24 PM
If you know how to do this, then please help me as soon as posible!
Thank you!

Joacim Andersson
Jan 24th, 2000, 10:23 PM
Hmmm... Actually you can't! Simply because Word can't send any e-mail. It actually just use the MAPI client (Outlook for example) that you have installed.

What you can do, if you want to use e-mail, is to add the MAPI controls to a form and use code simular to this to send it:

MAPISession1.SignOn
MAPIMessages1.SessionID = MAPISession1.SessionID
MAPIMessages1.Compose
MAPIMessages1.MsgSubject = "Testing..."
MAPIMessages1.MsgNoteText = "This is the body of my email"
MAPIMessages1.RecipAddress = "joacim@programmer.net"
MAPIMessages1.RecipDisplayName = MAPIMessages1.RecipAddress
MAPIMessages1.Send
MAPISession1.SignOff

Good luck!

------------------
Joacim Andersson
joacim@programmer.net
joacim@yellowblazer.com
www.YellowBlazer.com (http://www.YellowBlazer.com)