Thanks Paul for your reply.
Since I am so keen on Macrobuttons I put these {}-fields next to each other
{ Macrobutton AutoOpen Double-click Me }{ASK BkMk "Write your name here" \d {DOCPROPERTY Author}}}
And edited AutoOpen-macro a bit so it updates only {REF BkMK}-fields:
Code:
Sub AutoOpen()
'Updates/launches ASK-field next to Macrobutton
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.Fields.Update
'Updates only REF-fields with bookmark named BkMk
Dim Fld As Field
With ActiveDocument
For Each Fld In .Fields
With Fld
If .Type = wdFieldRef Then
If Split(Trim(.Code.Text), " ")(1) = "BkMk" Then .Update
End If
End With
Next
End With
End Sub
I was wondering could the inserted bookmark become the DisplayText for the MacroButton, similar to thread
https://www.msofficeforums.com/vba/7...html#post18034
Then there would be one extra line to the AutoOpen-macro, something like this:
Code:
Selection.Fields(1).Code.Text = "MACROBUTTON AutoOpen " & BkMk
But I don't know the correct format for BkMk-bookmark.