Using VBA to convert text to table

  • Thread starter Thread starter Mike K
  • Start date Start date
M

Mike K

I'm sending a comma separated string to Outlook via some Excel VBA
code. I'd like the VBA to automatically run the Table/Convert/Text To
Table function that's available in the Outlook toolbar.

Does anyone know how to do this?
 
To do this, you'd have to be sure that the reader is using Word to read Rich
Text messages. If that condition is satisfied, then you can run this macro
with the e-mail already open:

Sub ConvertToTable()
Dim objWord As Word.Application, objDoc As Word.Document

Set objDoc = ActiveInspector.WordEditor
Set objWord = objDoc.Application
objDoc.Select
objWord.Selection.WholeStory
objWord.Selection.ConvertToTable (" ")

Set objDoc = Nothing
Set objWord = Nothing
End Sub
 

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

Back
Top