Word sendmail command - reference?

  • Thread starter Thread starter Charles Kenyon
  • Start date Start date
C

Charles Kenyon

Office 2003 Pro

I am trying to write a macro that sends a protected form as an attachment
and creates parts of the email from the formfields. (It is a phone message.)
The email program is Outlook.

I know how to get the info from the formfields, I just don't know how to put
it into the email message as subject or message body.

Also, can I specify the recipient in the macro? Can I issue the send
command? (I would like the person taking the message to just be able to
press a Send button and not have to mess with the email message at all.)

Can anyone recommend references on the sendmail command, or do I want to be
programming Outlook? I have Sue Mosher's programming Outlook 2003.

--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide




--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
I'm not very familiar with SendMail but you certainly can do all that using
the Outlook object model.

Sub Whatever(s As String, b As String)
Dim oOL As Outlook.Application
Dim oMail As Outlook.MailItem
Dim oNS As Outlook.NameSpace

Set oOL = CreateObject("Outlook.Application")
Set oNS = oOL.GetNameSpace("MAPI")
oNS.Logon "", "", False, False

Set oMail = oOL.CreateItem(olMailItem)
oMail.Subject = s
oMail.Body = b
oMail.Recipients.Add "(e-mail address removed)"
oMail.Recipients.ResolveAll
oMail.Display

' oMail.Send to send it
 
Back
Top