daniel76
04-13-2008, 07:08 PM
Hi,
I have got a problem with implementing update fields in VBA in word document.
See that i have been using { DOCVARIABLE myvar } but the problem is it won't show the value of myvar unless i right-clicked on it and selected "update fields". It would then work. I have tried to implement printpreview in the code but to no avail.
with activedocument
.variables("myvar").value = TxtFirstName.Text
.printpreview
.closeprintpreview
endwith
Note: i typed in the codes, not copied directly from the VBA
Is there anyone know how to write codes to execute the update fields behind the scene? i tried to cheat by recording the macro but it didn't let me to carry out update fields. Hence, couldn't get the code.
BTW, this is for office word 03
Thank you in advance
I have got a problem with implementing update fields in VBA in word document.
See that i have been using { DOCVARIABLE myvar } but the problem is it won't show the value of myvar unless i right-clicked on it and selected "update fields". It would then work. I have tried to implement printpreview in the code but to no avail.
with activedocument
.variables("myvar").value = TxtFirstName.Text
.printpreview
.closeprintpreview
endwith
Note: i typed in the codes, not copied directly from the VBA
Is there anyone know how to write codes to execute the update fields behind the scene? i tried to cheat by recording the macro but it didn't let me to carry out update fields. Hence, couldn't get the code.
BTW, this is for office word 03
Thank you in advance