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 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.