Sending Data to Word

Sending data to Word is a matter of obtaining a selection object and then using the TypeText method of the selection object to pass Word the text you want included in your document:

' Add some text
    Set wrdObjsel = wrdDocObj.ActiveWindow.Selection
    wrdObjsel.Style = wrdDocObj.Styles("Heading 1")
    wrdObjsel.TypeText Text:="Now is the time for all good men to come to the
      aid of their party."
    wrdObjsel.TypeParagraph

Notice how you can format the text by providing a paragraph style prior to handing off the text. Notice also how the TypeParagraph method of the selection object begins a new paragraph.

Get Professional Development with Visio® 2000 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.