Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / October 2005

Tip: Looking for answers? Try searching our database.

Using VBA to convert text to table

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mike K - 29 Sep 2005 15:05 GMT
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?
Eric Legault [MVP - Outlook] - 05 Oct 2005 21:11 GMT
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

Signature

Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/

> 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?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.