View Single Post
 
Old 11-28-2014, 12:21 PM
Marrick13 Marrick13 is offline Windows XP Office 2010 32bit
Competent Performer
 
Join Date: Jun 2006
Posts: 102
Marrick13 will become famous soon enough
Default Macro to extract AutoTextList Field Screen Tip text

I am trying to build a macro that extracts both the display text and the screen tip text from an AUTOTEXTLIST field and writes it to a separate Word document table.

Since I have been unable to locate approaches that can do this, I thought the way to go was to loop through all AUTOTEXTLIST fields, capture each field’s display text, write it to a table cell, then loop again through the same fields, but with the codes switched on to reveal the screen tip text (which is in quotes). Unfortunately, I am using the selection method, partly because I don’t know how else to get text enclosed by quotes from a string (evidently there is no “collection” for it, unlike hyperlink links).

I got this to work reasonably well in step mode, but in real time, it extracts the display text but only the first screen tip text. At various times in the code to get the string tip text,, the code-driven selection extends well beyond the desired text to include several paragraphs. I thought that by separating the two extracts (display vs screen tip) would alleviate this, but it made no difference.

I’ve attached this latest version which does two loop sequences through a document, one to get the display and the other to get the screen tip. Can someone suggest a fix or an alternative method?

The macro and its test document are attached.
Attached Files
File Type: docm Screen Tip Format Test-2.docm (52.0 KB, 14 views)
Reply With Quote