Compile Error "Variable Not Defined" - Access 2007 - Word 2007

C

Callum Davidson

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
 
D

David-W-Fenton

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top