![]() |
|
#1
|
||||
|
||||
![]()
Hi ilkks,
If you check the formfield's 'calculate on exit' property, you don't need a macro to update the cross-references. Conversely, If you use an ASK field coded as: {IF{REF BkMk}= {DOCPROPERTY Author} {ASK BkMk "Write your name here" \d {DOCPROPERTY Author}}} or: {ASK BkMk "Write your name here" \d {DOCPROPERTY Author}} and an AutoOpen macro whose code is: Code:
Sub AutoOpen ActiveDocument.Fields.Update End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#2
|
|||
|
|||
![]()
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 Then there would be one extra line to the AutoOpen-macro, something like this: Code:
Selection.Fields(1).Code.Text = "MACROBUTTON AutoOpen " & BkMk Last edited by ilkks; 05-26-2011 at 03:32 AM. |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
bruce_hyman | Outlook | 2 | 10-25-2010 08:04 PM |
How to refer a field in another field | DaveSmith | Word | 0 | 08-24-2010 06:44 PM |
merge field formatting problem with "text to be inserted before" | wissam | Mail Merge | 0 | 12-13-2009 12:50 AM |
Field Help | BChianciola | Word | 0 | 11-09-2009 01:14 PM |
![]() |
Toshii | Word | 1 | 06-08-2009 07:21 PM |