Results 1 to 11 of 11
  1. #1
    3 Star Lounger
    Join Date
    Jun 2009
    Location
    Hemet CA
    Posts
    310
    Thanks
    0
    Thanked 0 Times in 0 Posts
    On a 2007 word document that Iím using, it has mutable link fields throughout, that re-fresh just fine upon opening of the document; it is just the link fields that are located inside of a header that I receive an Error! Not a valid link. I have checked and verified that the link still exist by using Shift/F9. Here is the code that I use to open document with.
    Code:
    Set worddoc = Documents.Open(ThisDocument.Path & "\ Reports\Client Information.docm")
    worddoc.Windows(1).Activate
    Is there anything that I can add to this code that may refresh the links in the header?
    Also I have the annoying message every time this document opens. Is there a way to eliminate this?
    Attached Images Attached Images
    • File Type: bmp 3.bmp (294.5 KB, 8 views)

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    What are the field codes, exactly?

    Does anything in this thread help or ring a bell? [topic=761784]Relative Paths in Word Fields (March 2009)[/topic]

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    About the prompt: there is a registry setting that controls it.
    - Click Start | Run...
    - Type regedit and press Enter or click OK.
    - Navigate to HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\W ord\Options.
    - Look for a value in the right hand pane named FieldCalcSecurityLevel.
    - If there is no such value, select Edit | New | DWORD Value, provide FieldCalcSecurityLevel as name and click OK.
    - Double-click FieldCalcSecurityLevel and set its value to 0.


  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    This post (click!) contains a macro that will update all fields in all storyranges (parts) of a document.

  5. #5
    3 Star Lounger
    Join Date
    Jun 2009
    Location
    Hemet CA
    Posts
    310
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank You HansV
    I just read over the comments of the other thread, very cool thanks
    I shall give it a try

  6. #6
    3 Star Lounger
    Join Date
    Jun 2009
    Location
    Hemet CA
    Posts
    310
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi HansV
    I tried using the method you left on post 718,492
    It did not seem to refresh the links in the header, all the other links on same document refresh just fine. I double checked to be sure the links was correct by using Shift/F9. It all looks good.
    I went through some of my old post and found that you help me with a linking problem before (I’m sure more than once). Here is one code you gave to me to help refresh my link fields on a read only document.
    Code:
    Sub AutoOpen()
      Dim fld As Field
        ActiveDocument.Unprotect "Password here"
      For Each fld In ActiveDocument.Fields
        fld.LinkFormat.Update
      Next fld
      ActiveDocument.Protect wdAllowOnlyReading, "Password here"
    End Sub
    Is there a way to add something to my existing code (Posted earlier on this thread)
    I tried to modify your previous code, but with no success?
    Code:
    Dim fld As Field
      ActiveDocument.Unprotect "Password here"
      For Each fld In ActiveDocument.Fields
        fld.LinkFormat.Update
      Next fld
      ActiveDocument.Protect wdAllowOnlyFormFields, "Password here"
    I like being able to have protection for my form fields

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    You'd have to loop through the storyranges as in the code I provided a link to.

    Another option is to briefly display the print preview; provided that Word has been set to update fields on print, that should update all links:

    Application.ScreenUpdating = False
    ActiveDocument.PrintPreview
    ActiveDocument.ClosePrintPreview
    Application.ScreenUpdating = True


  8. #8
    3 Star Lounger
    Join Date
    Jun 2009
    Location
    Hemet CA
    Posts
    310
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi HansV
    I tried so many different ways to have link fields refresh in the header or even footer
    What I did find was when I copied the text that I wanted to link to other pages, then used
    Paste Special \ Microsoft Office Word Document Object \ Paste Link , then press OK
    The links work great in both header and footer, no coding needed, even with protection or not, it still seems to refresh with no problems.
    But now I am having a problem with adjusting the size and color of text, it does not seem to want to make changes; the links work great thoughÖ.lol

  9. #9
    3 Star Lounger
    Join Date
    Jun 2009
    Location
    Hemet CA
    Posts
    310
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Any suggestions would be greatly appreciated
    I tried everything I can think of, does anyone know of a way that I can change the font color / size and type using a linked object
    Paste Special \ Microsoft Office Word Document Object \ Paste Link , then press OK

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    If you select Microsoft Word Document Object, the formatting is entirely determined by the source document. There is no way whatsoever you can change the formatting in the target document.

    If you want to be able to change the formatting in the target document, you must select Formatted Text, Unformatted Text or HTML.


  11. #11
    3 Star Lounger
    Join Date
    Jun 2009
    Location
    Hemet CA
    Posts
    310
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you HansV
    That was my dilemma; my source document formatting was different than my target document and in order for my links to refresh in my source document header I had to use Microsoft Word Document Object. I know I could have copied from link source, then using unformatted text to make needed adjustments, then use Microsoft Word Document Object to link to target document header. The problem I had there was, there was no place I could of hidden unformatted text on source document, not quite the same as an excel workbook where you can evertything.

    All my other links that are outside my header or footer I use Formatted Text, Unformatted Text and they work great. Once again I thank you for all of your assistance, no better way to learn than hands on

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •