Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
I am having trouble with writing a macro to loop through all fields existing in a documents and identifiy the ones tagged with $dimension.
The problem is that I don't know how to get the initial list of ALL existing Fields in the active document.
Can you help me with that?
Thanks,
Carmen
Hi,
Below code will give you list of fields.
Sub Test
Rem ** Show name of all non-system fields in document **
set flds = ActiveDocument.GetFieldDescriptions
for i = 0 to flds.count - 1
set fld = flds.item(i)
if not fld.IsSystem then msgbox(fld.Name)
next
End sub
Regards,
Kaushik Solanki
Hi,
Below code will give you list of fields.
Sub Test
Rem ** Show name of all non-system fields in document **
set flds = ActiveDocument.GetFieldDescriptions
for i = 0 to flds.count - 1
set fld = flds.item(i)
if not fld.IsSystem then msgbox(fld.Name)
next
End sub
Regards,
Kaushik Solanki
Great! That is what I needed.
Thanks a lot,
Carmen