Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Peony
Creator III
Creator III

Mistake in condition syntax VBS macro

Hi all.

There is some macro example. It should works on field click and send message foruser depending which value was selected. But instead of macro running I recive message "Macro parce failed. functionality was lost". What's wrong with it's  functionality?

sub notification

set vTOP = ActiveDocument.Fields("TOP").GetSelectedValues

if

$(vTOP) = 20

  then MsgBox "It's 20!"

  else MsgBox "Not 20"

end if

end sub

1 Solution

Accepted Solutions
m_woolf
Master II
Master II

There is no dollar-sign expansion in VBS.

This is from the API Guide:

set val=ActiveDocument.Fields("Month").GetSelectedValues

for i=0 to val.Count-1

    msgbox(val.Item(i).Text)

next

View solution in original post

2 Replies
m_woolf
Master II
Master II

There is no dollar-sign expansion in VBS.

This is from the API Guide:

set val=ActiveDocument.Fields("Month").GetSelectedValues

for i=0 to val.Count-1

    msgbox(val.Item(i).Text)

next

Peony
Creator III
Creator III
Author

Thank you. It helps.