Richard
Richard

Reputation: 1985

Is it possible to alter a marked field´s field function with Word 2007 VBA?

i want do the following:

In Word 2007 place the Cursor on a field (or mark that field) and call a macro wich edit the field function of that field. (add some string).

I´m even grateful for some tipps what term to google.

I used the macro recorder and got following:

WordBasic.FormatField Field:="CITATION Gro05 \p 9 \l 1031"

Thats obvious creats a new field but where to go from here?

To get the selected field i thought about something like this:

If Selection.Type = WdFieldType Then ...

I hope someone give me some hints :) Bye Richard

Upvotes: 0

Views: 532

Answers (1)

CoderDennis
CoderDennis

Reputation: 13837

Selection.Range.Fields

Will give you the collection of fields in the current selection.

Upvotes: 1

Related Questions