Discussion:
Compile Error "Variable Not Defined" - Access 2007 - Word 2007
(too old to reply)
Callum Davidson
2011-05-18 23:06:03 UTC
Permalink
Hi looking for help.

I'm merging data from Access 2007 with a Word Template 2007.

On this line I'm getting a "Variable Not Defined" "Compile Error"

Specifically at the wdFormatdoc bit.

wdTmp.SaveAs Left(strImage, Len(strImage) - 3) & "doc",
FileFormat:=wdFormatdoc

Anyone help me with a way around this problem?


Tx
David-W-Fenton
2011-05-21 19:35:23 UTC
Permalink
Post by Callum Davidson
I'm merging data from Access 2007 with a Word Template 2007.
On this line I'm getting a "Variable Not Defined" "Compile Error"
Specifically at the wdFormatdoc bit.
wdTmp.SaveAs Left(strImage, Len(strImage) - 3) & "doc",
FileFormat:=wdFormatdoc
Anyone help me with a way around this problem?
Does it tell you which variable is not defined?

If you're using late binding (and don't have a reference to Word
set), it would certainly be the case that the named constant
wdFormatdoc would not be defined.
--
David W. Fenton http://www.dfenton.com/
contact via website only http://www.dfenton.com/DFA/
Loading...