I want to ask the document-template-user to insert his name. And then his name automaticly get copied to different places around the document.
This is working:
I have Text From Field, I double-click it and insert the name to 'Default text', and I write to bookmark field 'testBookmark'. I got { REF testBookmark } all over the document. I select the whole document and update by pressinf F9. And voilą!
This is what I want:
I want more sophisticated approach of inserting the name. For example using ASK-field that is launched by doubleclicking MacroButton. The sub of the MacroButton is:
Code:
Sub Macro3()
' Macro3 Macro
' Launch ASK-field and update the REF-fields
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"ASK testBookmark ""Write your name here"" \d First name Last name \o ", PreserveFormatting:=True
Selection.WholeStory
Selection.Fields.Update
End Sub
This is not working properly. It updates REF-fields, which is fine, but. First of all it asks me to write the name 2 times, and after that the MacroButton disappeares. I want to keep MacroButton alive so I can change the name if necessary.