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

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -