Creating and inserting a field into a document fro ma macro?

M

ML

I currently have a user form that allows the user to select a given marker
that is inserted into a document at the cursor location. This form
basically inserts an autotext entry that has an underlying SEQ field.

What I would rather do is instead of inserting autotext is to actually
create the field dynamically and insert it direct with the same end result
as the autotext.

Is there a way to create a field with a SEQ in code and insert it into the
document?

Here is the item that is currently inserted via autotext:
{ QUOTE (S) { SEQ S\r { = { SECTION } *10000 + { PAGE \*Arabic }}\h}}
 
M

macropod

Hi ML,

You could use the vba Fields Add method, but that gets complicated with
nested fields.

See 'Add Method (Fields Collection)' in Word's help file.

Cheers
 

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