MS 2007 Word Merge - Word Code

K

Karen

I used Albert D. Kallal's simple word merge modules and directions to set up
several word merge documents in Access 2003. As I have no programming
skills, I'm thankful that they've worked beautifully in Access 2003 &
continue to do so.

Several persons in my company have received Access 2007. There is an error
that arises when they attempt to use the merges w/ this software. Seemingly,
the error is in the Word Code module. This line is highlighted in the
following section of the coding: If InStr(vText, Chr(34)) > 0 Then

Function qu(vText As Variant) As String
' takes a string and surrounds it with double quotes
' All " (double quotes) are converted to ' (single quotes) before
' this is done

If IsNull(vText) = False Then
If InStr(vText, Chr(34)) > 0 Then
vText = strDReplace(CStr(vText), Chr(34), "'")
End If
End If

qu = Chr$(34) & vText & Chr$(34)

End Function

Keep in mind -- I still have MS2003 on my computer and am able to merge in
the same database. Can anyone advise as to why this is happening in 2007 &
how I can fix it?
 
K

Karen

Sorry, I set it up on Access 2000 not 2003! Also, I still have 2000 version,
not 2003!
 
A

Albert D. Kallal

Karen said:
Sorry, I set it up on Access 2000 not 2003! Also, I still have 2000
version,
not 2003!

Hum, it should work with a2007.

I should probably post a a2007 version of the code, but the existing sample
should work with 2007.

I would suggest you try and download the latest version of my code.

you can find it here:

http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html

Then, simply delete the two forms, and the two modules..and re-import the
code. There has been a few bugs fixes over the years, and I don't know how
"late" of a version of you have.....

The forms are:
GuiProgress
GuiWordTemplate

The two code modules you have to import are:
clsRidesPBar (the progress bar code)
WordCode (the code for Word Merge)


So, simply delete the above 2 forms and modules in your existing 2007
example, and then
re-import the above.

I notice that the "qu" code you posted does not have error handling code,
and my latest version does have error code. Thus, I have issued a fix for
your
problem.
 
K

Karen

The persons, on ac2007, said they could merge on the new software thru the
middle of last week. Now the form, with the merge commands, doesn't even
show the fields/records. When they click on the "MERGE THIS RECORD" command
button, they get a runime 2427 error.

They are, however, able to view the records on other forms that do not
include command buttons/vba code. Even after changing the security dialogs
in the Trust Center Settings to allow all, the trouble persists.

Is it possible that our IT unit (responsible for the server housing this
database & rolling out the new PCs/software in this instance) changed the
security settings for the new pcs' users sometime after it worked perfectly
on ac2007?

I will use your updated version - as soon as my company's help desk gives me
back access to your link.
 
K

Karen

Thanks Albert. I was able to upload your revised forms & modules. It made a
bit of difference in that we can now see the word templates in the 2007
versions.

However, the data source (an Access query producing data in the form) seems
to be giving trouble. When I click on the merge button, it gives the list of
templates. When I pick one, the computer does the merge but because there's
no data to merge it with, it's unsuccessful.

How can I get the data from access to be read into the word tempates?
 
K

Karen

I simply recreated the form and added the command button. Those on AC2007
are able to view the data and the merge works perfectly now. I don't know
why it didn't work on the old form.
 

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