Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro to get list of ALL fields tagged with $dimension

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

1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

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

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

2 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

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

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Great! That is what I needed.

Thanks a lot,

Carmen