We have a program called MasterPack (old school dos style) which we generate quotes from and this picks up a quote.doc in a folder called Quotes in the C drive which is a mail merge document and populates all the fields. There are 3 files in this Quotes folder, quote.doc, QUOTE.txt, and quote.hed
Recently one of my employees had his PC upgraded to a new unit and it came with Office 2007 (previously used 2003) and now we have this run time error.
So what happens now is we go through the steps and then it gets to the "Opening this document will run the following SQL command" and click Yes to continue, the SQL msg comes up again (that never happened before) so we click yes again. It thinks then opens the word doc and populates the fields but then the run time error window pops up and if we choose "End" the merge fields are not populated and return to the merge field names EG. <
if we choose debug we get the VB window with this section highlighted in yellow WordBasic.Activate "Quote.doc"
Then we close that and lose all data again.
I am assuming it's something to do with 2007 and compatibility with the old quote.doc template being in 2003.
can anyone confirm this and offer a simple solution or do i need to rewrite the quote.doc in Word 2007. I would like to keep it in 2003 for compatibility reasons, which reminds me when 2007 opens the template it does say "Compatibility mode"
clear as mud right?
vb runtime error 504 seems to be Object net safe for creating which might mean that you've got your macro security settings too high or something.
So what happens now is we go through the steps and then it gets to the "Opening this document will run the following SQL command" and click Yes to continue, the SQL msg comes up again (that never happened before)
Also, Word mail merge documents go through a sequence of attempting to locate it's data file and it looks like it's failing if you see the SQL message multiple times - it might be that Word 2003 had the current directory configured correctly, and Word 2007 might be working in a different directory. Maybe try putting the full path in the macro instead of a relative path e.g. WordBasic.Activate "C:\Path\To\MergeDoc\Quote.doc" ?
mmmm...thanks Dazhel I'll take a look at both those things tomorrow.