Mathias
Mathias

Reputation: 69

Copy content from table in a mail to another mail using VBA in outlook?

I am trying to get started with VBA in outlook and I was wondering if anyone had code that copied and pasted the content of one cell from a table in an outlook mail to another mail (only the content - not the cell or table)?

A small piece of example code would be great.

Best regards

Upvotes: 0

Views: 438

Answers (1)

Eugene Astafiev
Eugene Astafiev

Reputation: 49395

It looks like you need to parse the message body and find the required value. Then paste it to another message body.

The Outlook object model provides three main ways for working with item bodies:

  1. Body.
  2. HTMLBody.
  3. The Word editor. The WordEditor property of the Inspector class returns an instance of the Word Document which represents the message body. So, you can use the Word object model do whatever you need with the message body.

See Chapter 17: Working with Item Bodies for more information.

Also you may find the Getting Started with VBA in Outlook 2010 article helpful.

Upvotes: 1

Related Questions