Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    San Francisco, California, USA
    Posts
    358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    IncludePicture with DocVariable

    Hi All,

    I'm trying to use a DocVariable with an IncludePicture field in a template. My field code looks like this:

    { INCLUDEPICTURE "{ DOCVARIABLE MyImage }" }

    and my code looks like this:

    ActiveDocument.Variables("MyImage") = lblMyImage (where lblMyImage would contain z:\\templates\\images\\img1.gif or whatever the user selects in a form from a dropdown box)

    The problem isn't with the code, though, it's with the behavior of Word 2003. For some reason, when I try to save the template, it replaces the { DOCVARIABLE MyImage } with the location of the template on my c drive, so I get { INCLUDEPICTURE "c:\\MyDesktop\\Template.dot" } instead of the docvariable that I want to save.

    Any ideas on what I might be doing wrong? I've gone through the menus under Tools-->Options and all the tabs and unchecked anything that I thought might update the docvariable automagically, but it still reverts. I've tried recreating the field codes over and over, sometimes using the toolbar to automatically insert them, and other times using <ctrl>F9, but there appears to be no difference.

    Incidentally, there are other docvariables in the template that don't behave like this, but they're not related to an IncludePicture field.

  2. #2
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts
    What happens when you select the field and update it? If this works but saving breaks it then I would suspect that you have a macro called FileSave that is causing the issue.

    If this is not the case, can you post a cut down version of your template which includes the field you are having problems with?
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    San Francisco, California, USA
    Posts
    358
    Thanks
    0
    Thanked 0 Times in 0 Posts
    After hours of searching and lots of frustration, I stumbled upon someone else who encountered this quirk of Word 2003.

    http://help.lockergnome.com/office/I...ict949037.html

    From the Tools menu, select Options and then on the General tab, click on
    Web Options and then select the Files tab and uncheck the option to Update
    links on save.

    Turning this off solved my problem.

  4. #4
    3 Star Lounger
    Join Date
    Apr 2001
    Location
    Levin, Manawatu-Wanganui, New Zealand
    Posts
    324
    Thanks
    9
    Thanked 28 Times in 26 Posts

    Nested docVariable fields

    Hi Ceceilia
    I created a form with a text box to store the path to the pic.
    Important that I included the double slash in pathname

    The OK click created the docVariable and populated it with contents of textbox.
    The images show the field codes and the results.
    It seemed to work.

    Enjoy
    Geof
    Attached Images Attached Images
    Attached Files Attached Files

Posting Permissions

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