vba - Updating the text displaid in MACROBUTTON in MS Word -
i using macrobutton in vba have field value calculated accessing other system, , @ same time, want able double-click on field specify settings used retrieve data other system.
the whole macro stuff works fine can not figure out how change label on macrobutton.
typically macrobutton looks { macrobutton macro_name label {some_arg}{some_arg2} }
i tried accessing selection.fields(1).code.text , doing regexp replace 'label' else not work, i.e. either lose args or screw label.
any advice issue, or perhaps suggestion of other type of field use achieve this? wouldn't mind using docvariable these can not respond clicks , carry arguments?
you should able this:
sub testit1() dim strtext string dim strlabel string dim strnewlabel string strlabel = "chew" strnewlabel = "devour" ' replace field code values in first field change label strtext = activedocument.fields(1).code.text activedocument.fields(1).code.text = replace(strtext, strlabel, strnewlabel) end sub
this search , replace inside field code macrobutton field want change. activedocument.fields(1).code.text
part think looking for.
Comments
Post a Comment