Albert Kallal's WordMerge

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

This looks great and I downloaded the samples and then loaded them into my
database.
But when I try to Add a new Template, enter the name and click OK, Word
attempts to start and then fails with error msge 5174 (merge.888 not found)
and the debugger highlights the following area:
WordDoc.MailMerge.OpenDataSource _
Name:=strSaveDir & TextMerge, _
ConfirmConversions:=False, _
ReadOnly:=False, LinkToSource:=True, AddToRecentFiles:=False, _
PasswordDocument:="", PasswordTemplate:="",
WritePasswordDocument:="", _
WritePasswordTemplate:="", Revert:=False, Format:=0, _
Connection:="", SQLStatement:="", SQLStatement1:=""

By the way, I am using Office Pro 2002.
I really really want to be able to use this code as it does look very nifty,
so would Albert or anyone else be able to help me out please!
Thanks
CW
 
Just out of curiosity, what are the values for strSaveDir and TextMerge when
you get the error?
 
Douglas -
What you see is what I get. In other words, if I understand what you are
looking for, both values are blank. Which, I assume, is a major part of the
problem. But there is nothing in Albert's notes about setting up paths or
filenames - it looked to me as though this Add New Template process did the
whole thing for you. Did I go wrong with this? Should I have set up some
other bits and pieces (to use the non-technical term)?
Many thanks
CW
 
First, give the same a try. If the sample can't run then we really dig
ourselves a hole if skip this, and then try to use this right in your
application.

So, #1, were you able to test/try the sample?

did the sample work?

Lets get the above working, and THEN try to do this in your code....


if the sample works on your machine, the next question would be is your mdb
on a different computer/network?
 
Albert -
Glad you're onto this, thank you.
Yes the sample runs absolutely fine, it is Sooo good that's why I'm keen to
get this working in my own mdb.
I can not only run your existing template, it opens up the "see you in
Edmonton" letter, I can also add a new one of my own and then go to the
Contacts form and select it and fire that up, just fine.
Everything is on my C: drive.
Look forward to your suggestions...
Thanks
CW
 
Well, whaddya know - good old user error. Stoopid me, I had saved module
WordCode as WordMerge. To be on the safe side I deleted it and re-pasted it
into my mdb and it runs fine now!!
A different question now: how do I get the fields from my own tables into
the Word template, rather than the standard ones offered by Word?
Thanks again
CW
 
Ok, so we have the mdb sitting on your computer (my sample)....

and, the above works....

Ok, so, it assumed that YOUR mdb is also on YOUR computer. (if it is not,
then we already have a difference).

Assuming the above, the next step is to incorporate the code into your
appcation. the steps are here:

http://www.members.shaw.ca/AlbertKallal/wordmerge/page2.html

After you copy the code as above instructions. You then should do a
debug-compile while looking at code. And, note if you are using a2000, or
a2002, then you need to set the reference (the above explains this).

At this point, you should be able to place a word merge button on any of
your existing forms that are bound!!!

....The code behind the button would be


MergeSingleWord

That is it!!

So, try the above....does it work?

Often, the location of the mdb file can be a issue, since my code tries to
create a directory called word, and if it can't, often it fails. So, you
could also as a test check the "word" dir is/was created. (and, if not..try
creating the directory manually -- it goes in the same directory as the mdb
file -- which, up to this point we assumed is on your computer -- and,
perhaps try placing my sample in the same directory as your mdb file..and
see if the sample runs in that case).

Also...what version of ms-access are you using?
 
CW said:
Well, whaddya know - good old user error. Stoopid me, I had saved module
WordCode as WordMerge. To be on the safe side I deleted it and re-pasted
it
into my mdb and it runs fine now!!
A different question now: how do I get the fields from my own tables into
the Word template, rather than the standard ones offered by Word?
Thanks again
CW

If you used my system to make the template, then the fields should
appear.....

Here is a set of screen shots....

http://www.members.shaw.ca/AlbertKallal/wordmerge/index.html

There is a SPECIFIC screen shot in the above that shows the button to click
that "should" display the merge fields..

So, if you place a button on one of your forms, and behind the button just
go

MergeSingleWord, then the above series of screen shots should work for you.

note how there is a button to "list" the fields in word.....
 
Albert -
Many thanks the merge is now working fine.
However as mentioned earlier I now have this question:
How do I get the fields from my own tables into
the Word template, rather than simply the standard ones offered by Word's
mergefield icons/dropdowns?
Thanks again
CW
 
CW said:
Albert -
Many thanks the merge is now working fine.
However as mentioned earlier I now have this question:
How do I get the fields from my own tables into
the Word template, rather than simply the standard ones offered by Word's
mergefield icons/dropdowns?
Thanks again
CW

See the series of screen shots here:

http://www.members.shaw.ca/AlbertKallal/wordmerge/index.html

Note how there is a merge button in word for you to add your fields...

If you created a button on a existing form in your application, the code
behind the button should be

MergeSingleWord

When you create a template, you should see all of the data fields that the
form has now in the word merge document. In the above screen shots, you can
see both a word 97 example, and a word 2000 example.....
 

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

Back
Top