macro outlook

  • Thread starter Thread starter azerpoi
  • Start date Start date
A

azerpoi

Hi,
First of all, I have to say that I have nearly no knowledge in programming.
Secondly my mother language is French and therefore I apologize in advance
for my mistakes in english.
I use Outlook 2000.
I would like to create a macro to do the following :
- I receive several times a day messages that I have to transfer to a
colleague of mine. But before transferring, I have to make some alterations
in the orginal text, such as deleting some parts or increasing the font size
of some other parts.
Could you give me some advises in the way to write such a macro ?
Thank you in advance for any information.
Patrick
 
This sample demos how to trap new items:
http://www.vboffice.net/sample.html?mnu=2&lang=en&smp=48&cmd=showitem&pub=6

You might adapt the ItemAdd event for your needs. First, check if the new
item is one that you want to forward to your colleague, maybe check by its
Sender or Subject property.

This creates a forward for the item and stores the reference to it in a
variable:

Dim Forward as Outlook.MailItem
Set Forward=Item.Forward

The e-mail must be in HTML, so that you can change the font-size. Easiest
approach would be to use Word as maileditor. You might set that via
Tools/Options. Then Forward.GetInspector.WordEditor returns a reference to a
Word.Document object.

Add a reference to the Word library to your VBA project via
Tools/References. Then open the object brwoser (f2), switch from <All
Libraries> to Word and select Document in the left pane. In the rigth pane
you can see then all of its properties. Select anyone and click f1 for
getting more help for it.

In principle, you can search for text within your e-mail with the Instr
function. Just type it and press f1 for help. If the original e-mail is in
HTML already then search the text in the item's HTMLBody property else in
its Body property.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Synchronize Color Categories & Ensure that Every Item Gets Categorized:
<http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6>

Am Thu, 1 Nov 2007 21:00:34 +0100 schrieb azerpoi:
 
Back
Top