VBA to creating autotext entries or quickparts in different catego

P

Peter

I have a VBA application that basically allows people to easily create
autotext entiries, move them between machines and use them making comments on
assignments. Currently it operates in EXACTLY the same way in Word 2003 and
2007 (using userforms) and I want to keep that as long as possible. You can
see the application at
http://emarking-assistant.baker-evans.com and either the screen image or
the video demos will give you an idea of what I am doing

Currently I store all the comments in a long list of autotext entries that
is displayed in a field with the value of the entry shown underneath (so you
don't have to remember). This is OK but people are now wanting to have
different categories of comments e.g. grammar, presentation, content,
assignment 1. These would be stored in separate files and displayed on the
userform using tabbed fields.

I'm currently using
normalTemplate.AutoTextEntries.Add Name:=rgName.text, Range:=rgEntry
when I read the text from the table to create the autotext entries.

My question is: how can I use the AutoTextEntries.Add method to create
autotext entries that are in different categories so it works in 2003 and
2007?

I've tried the good old record the macro in 2003 and see what is produced
method it does not seem to have an argument for the category or style. Can
Word 2003 create autotext entries in different categories?

In Word 2007 it seems that I need to use
objTemplate.BuildingBlockEntries.Add(Name:="New Building Block Entry",
Type:=wdTypeWatermarks, _
Category:="General", Range:=Selection.Range)

Any assistance would be VERY gratefully received.
 
G

Graham Mayor

One of the major differences between Word 2003 and Word 2007 is the way they
handle autotext. Word 2003 files autotexts by the paragraph styles applied
to the stored texts. Word 2007 uses building blocks which can categorize
entries into various groups. As Word 2003 VBA doesn't understand building
blocks there is no way to create a single macro that can be selectively used
in both versions.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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