ms word - Add specific citation based on user selection with vba -


i trying create userform user selects year , citation specific book inserted based on option. have tried inserting docvariable (called "bookyear") field inside text , changing variables value (to "aus15") through vba. code below doesnt work think i'm on right path

sub macro2()     if mycombobox = 2015         activedocument.variable("bookyear").value = "aus15"         activedocument.fields.update     end if end sub 

found answer

mytext = "aus15"

selection example: ''çode select bookmark selection.fields.add range:=selection.range, _

type:=wdfieldcitation, text:=mytext


Comments

Popular posts from this blog

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -

javascript - Restarting Supervisor and effect on FlaskSocketIO -

php - Mongodb connectivity error -