Table Question in Outlook Email

  • Thread starter Thread starter JP2R
  • Start date Start date
J

JP2R

I've created a template in Outlook

In the body I have a created a table - and have been manually entering the
data - but am looking for a way to take:

Row 1 Column 2 of table to be the Subject line
Row 2 Column 2 of table to be the name of the person in the To:

Is there a way to get this so that it automatically does it? VBA? Maybe?
 
All Outlook form code is VBScript code.

It depends on the type of table you added and if that table's addressable
using code or not. If it is addressable and those properties are there when
you open the item you can populate your table with those values in the Open
event handler. Otherwise you can add a button to the form and when it's
clicked the event handler can populate the table.

But as I said, it all depends on the table and if it's addressable.
 
I'm new to doing things in terms of automation with Outlook.

I have taken a table that was in Word 2007 and copied and pasted it into the
Outlook email. I didn't know any other way to accomplish this...

Would it help if I provided a sample? So that you can see how I have
accomplished what I've done so far?

Or do you have an example that I could look at...?

Most sincerely,
 
That's just a table pasted into either WordMail or HTML mail. In either case
it's part of the Body property. If you're using WordMail you can get the
Body as a Word.Document using this:

Dim oDoc 'As Word.Document
Set oDoc = Item.GetInspector.WordEditor

Then you can use the Word object model to work with the document and find
the Word table, etc.

If it's HTML and no WordMail you would use Item.GetInspector.HTMLEditor and
then use the IHTMLDocument interface to work with the table (if you can).

The use of Item would only work in VBScript form code. Otherwise you'd have
to instantiate a MailItem from your form or open item (ActiveInspector).

I have no sample code that deals with that which I can provide.
 
Excellent!

You've given me a great start...!

I appreciate you taking the time to reply!

-- J
 
Back
Top