none
What is VBA Field Property to Disable Automatic Updating for a Link-Field? RRS feed

  • Question

  • Hi

    What's VBA property to change the "automatic updating" option of a linked field in Word?

    I'm not trying to disable automatic updating globally (done in Word Options screen). 

    I'm trying to disable auto-updating for an individual field-- manually done by: right-click on field > Linked Binary Worksheet Object > Links, which brings up Links dialog box, then change "Automatic Update" to "Manual Update". 

    Changing to "Manual" removes the "\a" switch from the field code for that field. 

    In VBA, i could build up the whole code string with concatenation, but i prefer using VBA objects. 

    For example, the Field object includes the ".OLEFormat.PreserveFormattingOnUpdate" property, which is equivalent to inserting "\* MERGEFORMAT" into the field code. 

    What is the VBA property for inserting "\a" into the field code?

    thx

    Monday, February 22, 2016 7:52 PM

Answers

  • found it!

    "MyField.LinkFormat.AutoUpdate = False"

    But, when i run that, i'm getting "Command failed". 

    I welcome any help on that. 

    thx!

    • Marked as answer by johny w Monday, February 22, 2016 8:24 PM
    Monday, February 22, 2016 8:24 PM

All replies

  • found it!

    "MyField.LinkFormat.AutoUpdate = False"

    But, when i run that, i'm getting "Command failed". 

    I welcome any help on that. 

    thx!

    • Marked as answer by johny w Monday, February 22, 2016 8:24 PM
    Monday, February 22, 2016 8:24 PM
  • >>>But, when i run that, i'm getting "Command failed".

    According to your description, if I don't misunderstand, you could refer to below code:

    Sub Demo()
    '
    ' Demo Macro
    '
        Debug.Print ActiveDocument.Fields(1).LinkFormat.AutoUpdate
        ActiveDocument.Fields(1).Update
        ActiveDocument.Fields(1).LinkFormat.AutoUpdate = False
        DoEvents
        
    End Sub

    In addition could you provide more information about your issue, for example sample codes, screenshot etc., that will help us reproduce and resolve it.

    Thanks for your understanding.


    Tuesday, February 23, 2016 6:50 AM