Getting Data from Word

Obtaining text from Word to pass back to Visio is a matter of collecting the text you want and assigning it to a string variable. Then you can pass that reference to the text property of the subject's Visio SmartShape symbol. You can select the entire document's text as in

Selection.WholeStory
    Selection.Copy

Or if text has already been selected:

Selection.Copy

To programmatically select text in a Word document, you will need to make use of both the selection object and the range object.

Here is an example of selecting the first paragraph of the document:

ActiveDocument.Paragraphs(1).Range.Select

Here is another example in which you select the character count from a specific point within the document to an ending point: ...

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.