AutoText or VBA

U

utnj

I have a template that currently uses a custom toolbar to call macros,
which then insert AutoText using WordBasic functions. I need to make
changes to the existing AutoText entries, add new functions, and make
some general enhancements to the template.

I am assuming I should first replace the WordBasic functions with the
VBA Equivalents....
ex: WordBasic.WW7_EditAutoText Name:="PreDefinedAutoText", Context:=0,
Insert:=1
changes to...
ActiveDocument.AttachedTemplate.AutoTextEntries("PreDefinedAutoText").Insert
Where:=Selection.Range, RichText:=True

Would I be better off placing all the formatting within the VBA
function itself, or still using AutoText to set the formatting? Note:
The types of information stored in the AutoText entries are mainly
Table Layouts, but there are also bullets, Headings, Page Breaks, etc.
 
J

Jay Freedman

I think the answer is "some of each".

For table layouts, definitely continue to use AutoText entries. Later
versions of Word have "table styles" but they don't link to paragraph
styles for the text in the cells, so AutoText is the only way to store
both together.

For most of the other things you mentioned, you probably don't need
VBA at all, but you should define paragraph styles that include the
proper formatting. For the user's convenience, you can set up toolbar
buttons to apply the desired styles.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 

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

Top