View Single Post
  #9   Report Post  
Ed B
 
Posts: n/a
Default

Cindy,

I don't have the ability to change the registry keys on my computer as I am
not an administrator, also, this would have to be done on a number of
computers that are trying to use this routine (nine associates use the
database and prepare letters automatically from it). I don't believe our
company policy on security would allow the change of the registry keys anyway.

I can open the Standard document from within Word and connect to the
database and the letter will merge with the proper data table in the access
database.

I don't understand what you want me to substitute the numbers for in the
three lines . 0 should be substituted for what? I apologize if I sound dumb,
but I am not that familiar with VBA code.

Again, thanks for your help.
--
Have a nice day, Ed


"Cindy M -WordMVP-" wrote:

Hi ?B?RWQgQg==?=,

I had to remove the "md." from the following lines to get it to compile
.Destination = wd.wdSendToNewDocument
.FirstRecord = wd.wdDefaultFirstRecord
.LastRecord = wd.wdDefaultLastRecord

After I did that, I tried to run the macro, and got the following error
"Run-Time error '5852' Requested object is not available"

and the debugger highlighted the following line of code:
..Destination = wdSendToNewDocument

Try substituting the following, in order, in the three lines
0
1
-16

Note, however, that the error message could mean there's a problem with
state of the mailmerge document, not with the actual code I gave you.

From the sound of it, you may have lost the link to the data source. As a
matter of fact... See the following article, and make the suggested
change to the Registry key mentioned. Then open the document manually and
connect to the data source, save and close. Now test the code again.

"Opening This Will Run the Following SQL Command" Message When You Open a
Word Document - 825765
http://support.microsoft.com?kbid=825765

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)