Page 1 of 16 12311 ... LastLast
Results 1 to 15 of 234
  1. #1
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Word Relative Field Paths Discussion

    Hi macropod,

    That is a very interesting approach. It works fine for me with the INCLUDETEXT and HYPERLINK fields.
    For INCLUDEPICTURE fields, however, it only works until the document is saved. At that point, the FILENAME field disappears, to be replaced by the relative path of the picture. I'm using Word 2002 SP3.

  2. #2
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts

    Re: Relative Paths in Word Fields (All)

    Hi Hans,

    Thanks for the feedback. This is the first instance I've heard of INCLUDEPICTURE fields doing that. They behave as described in Word 2000 and Word 2007.

    Evidently there's something odd about Word 2002 SP3.
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Relative Paths in Word Fields (All)

    The macro you added does work in Word 2002 SP3 for INCLUDEPICTURE fields (but then, Word 2002 tends to change the path in an INCLUDEPICTURE field to relative at the drop of a hat...)

  4. #4
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Warrington, Cheshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Relative Paths in Word Fields (All)

    Hello, Macropod.
    I'm trying to implement your VB solution for relative links. I've imported the file but it's not working. I've proved that the AutoOpen routine is not being entered (by putting a MsgBox at the start; this never gets executed)
    Have you any ideas about why this should be? What have I done/not done?
    Thanks
    Silverback
    Silverback

  5. #5
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts

    Re: Relative Paths in Word Fields (All)

    Hi Silverback,

    Are you sure you've put the macro in a module attached to the document you're trying to update, and not its template or the Normal.dot template?

    Also, have you checked that your macro security level isn't set too high?
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Relative Paths in Word Fields (All)

    It's not your fault. AutoOpen doesn't run when it's declared as a private procedure. To correct this, change the line

    Private Sub AutoOpen()

    to

    Public Sub AutoOpen()

  7. #7
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts

    Re: Relative Paths in Word Fields (All)

    Thanks Hans,

    I wasn't aware of that.
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Relative Paths in Word Fields (All)

    To be frank, I wasn't aware of it either (I had tested your macros by running them manually), but it was the only thing that struck me as a possible explanation for AutoOpen not running, and it turned out to be so.

  9. #9
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Warrington, Cheshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Relative Paths in Word Fields (All)

    Many thanks to Paul and Hans <img src=/S/thankyou.gif border=0 alt=thankyou width=40 height=15>
    I changed the declaration of AutoOpen as Hans suggested and lowered the macro security level to medium (so Word prompts me) as Paul suggested and it's all working!

    This is going to save me literally hours of work and make the output more usable for the end users (because they will be able to update links without having to globally edit the links - obviously very error prone - which is all I was (cap)able to do for them this year.)

    Thanks again
    Silverback
    Silverback

  10. #10
    New Lounger
    Join Date
    Mar 2008
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Relative Paths in Word Fields (All)

    Hi Macropod

    Will your addin accept 2007 file extensions now - the version I currently have does not?

  11. #11
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts

    Re: Relative Paths in Word Fields (All)

    Hi Jen,

    Are you referring to the macro? Or to the field coding? The macro was last updated in September this year, but I'm not aware of anything in the code that prevents it from working with Word 2007 files. Do note, though, that macros don't work in files saved in the docx format - you must use either the old doc format or the new docm format if your file has macros.
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  12. #12
    New Lounger
    Join Date
    Mar 2008
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Relative Paths in Word Fields (All)

    Hi,
    I was just reading the text in a previous version that said this only works with doc or dot files - so I was assuming it didn't like 4 characters .dotx etc in 2007. Thought I'd ask you it is much quicker.

    Thanks

  13. #13
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts

    Re: Relative Paths in Word Fields (All)

    Hi jen,

    I'm not aware of anything indicating
    <hr>this only works with doc or dot files <hr>
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  14. #14
    New Lounger
    Join Date
    Mar 2008
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Relative Paths in Word Fields (All)

    Hi Macropod

    10-261488 FieldLinkUpdater
    "Source filenames are expected to have a 3-letter extension (eg filename.ext). If they do not, the macro will not work correctly."

    Obviously it doesn't matter then. Thank you.

  15. #15
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts

    Re: Relative Paths in Word Fields (All)

    Hi jen,
    <hr>10-261488 FieldLinkUpdater
    "Source filenames are expected to have a 3-letter extension (eg filename.ext). If they do not, the macro will not work correctly."<hr>
    Ah, that quote is from a different thread - see <post#=261488>post 261488</post#>. Whilst the subject is related, it isn't quite the same. The Field Link Updater in <post#=261488>post 261488</post#> would indeed need some changes to work with files having 4-character extensions. Neither the field coding nor the macro attached to the originating post in this thread (<post#=670027>post 670027</post#>) would need such a change.
    Cheers,

    Paul Edstein
    [MS MVP - Word]

Page 1 of 16 12311 ... LastLast

Posting Permissions

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