Reading from subject and writing to "To"

M

maximax_london

I've never written a VBA macro for Outlook, so I don't know where to
begin.

I need to a macro that reads text from an external file and puts it
into the To box of the active message. The file it reads from is
dependant on the contents of the Subject line, so I need to know how
to reference this as well.

Any help would be very, very much appreciated!


Thanks!

Max
 
M

maximax_london

Hi Max.  Are you familiar with Visual Basic?  If you are a programmer I can
certainly help you build this solution.

--
Eric Legault - MVP - Outlook
MCDBA, MCTS (Messaging & Collaboration, SharePoint Infrastructure, WSS 3
Application Development, MOSS 2007 Application Development)
Blog:http://blogs.officezealot.com/legault
Try Picture Attachments Wizard for Outlook!http://www.collaborativeinnovations.ca








- Show quoted text -


I'm very familiar with VB. I just haven't coded VBA for Outlook before
and so don't know the properties, methods, functions, etc specific to
Outlook.
 
E

Eric Legault [MVP - Outlook]

Hi Max. ActiveInspector.CurrentItem will get you the MailItem object for
the open e-mail. MailItem.Subject will get you the subject line.

To reference an external file, use the functions from the VBA.FileSystem
class or use the TextStreamObject from the Microsoft Scripting Runtim
Library.

Eric


Hi Max. Are you familiar with Visual Basic? If you are a programmer I can
certainly help you build this solution.

--
Eric Legault - MVP - Outlook
MCDBA, MCTS (Messaging & Collaboration, SharePoint Infrastructure, WSS 3
Application Development, MOSS 2007 Application Development)
Blog:http://blogs.officezealot.com/legault
Try Picture Attachments Wizard for
Outlook!http://www.collaborativeinnovations.ca








- Show quoted text -


I'm very familiar with VB. I just haven't coded VBA for Outlook before
and so don't know the properties, methods, functions, etc specific to
Outlook.
 
M

maximax_london

Hi Max.  ActiveInspector.CurrentItem will get you the MailItem object for
the open e-mail.  MailItem.Subjectwill get you thesubjectline.

Toreference an external file, use the functions from the VBA.FileSystem
class or use the TextStreamObject from the Microsoft Scripting Runtim
Library.

Eric

Thanks Eric,

And how do I write to the To and Cc line?


Max
 
E

Eric Legault [MVP - Outlook]

There are MailItem.To and MailItem.CC properties that you can put addresses
in. It's best to use the MailItem.Recipients collection to add/remove
message recipients though, as you can use the Resolve method to validate the
e-mail addresses.


--
Eric Legault - MVP - Outlook
MCDBA, MCTS (Messaging & Collaboration, SharePoint Infrastructure, WSS 3
Application Development, MOSS 2007 Application Development)
Blog: http://blogs.officezealot.com/legault
Try Picture Attachments Wizard for Outlook!
http://www.collaborativeinnovations.ca
 

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