Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / April 2005

Tip: Looking for answers? Try searching our database.

Word 2003 Mailmerge problem - works in Word 2000

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rick Robinson - 27 Apr 2005 16:48 GMT
Hi

I have a Word VB script and template .doc file that works fine
with Word 97 & Word 2000, but not with Word 2003. I am running Windows
XP SP1. Word 2003 is version 11.6359.6408 SP1

I get:

Microsoft Visual Basic
Compile error:
Assignment to constant not permitted

The data is exported from an accounts application to a .CSV file.  As
soon as the CSV file has been created, Word is invoked.

The Word macro then loads the csv file, along with a Word template
document, that has for example:  {MERGEFIELD Contact_Name_CZ}  in it.

The first problem is that with Word 2003, I get the error as
documented on this web page:

http://support.microsoft.com/default.aspx?scid=KB;EN-US;825765

Once I have amended my registry and rebooted to get around the above
error, I try the export again and the VB Macro gives an error saying:

Microsoft Visual Basic
Compile error:
Assignment to constant not permitted

It highlights the word "wddirectory =" and stops.

The relevant snippet is:

If wdtype = "Normal" Or _
wdtype = "Numbered" Or _
wdtype = "List" Or _
wdtype = "Lookup" Then
FileType = wdtype
wddirectory = Documents(File).CustomDocumentProperties("G3000
Directory")
If Err.Number <> 0 Then
If FileType <> "Normal" Then
DisplayPropertyError File, "G3000 Directory", " not defined", ""
GetCustomProperties = False
Else
LookupPath = "C:\"
ChangeFileOpenDirectory LookupPath
End If

Once I close that box, it returns to the Word template doco without
filling in the info from the mail merge.

I have Word 2000 installed on the same machine and so it's using the
same dataset. Word 2000 works, Word 2003 doesn't.

What needs to be changed in the VB script? I have searched google.com
to no avail.

Cheers, Rick
Peter Jamieson - 27 Apr 2005 17:43 GMT
The problem is that the mail merge type "Catalog" that existed in Word 2000
has been renamed to "Directory", and a new constant was introduced
(wdDirectory) to reflect this. So that is the constant that your code is now
trying to change - you will need to rename your wddirectory variable to
something else throughout your code.

Peter Jamieson

> Hi
>
[quoted text clipped - 56 lines]
>
> Cheers, Rick
Rick Robinson - 28 Apr 2005 10:16 GMT
Peter,

Thanks - you're a star!

- Rick

>The problem is that the mail merge type "Catalog" that existed in Word 2000
>has been renamed to "Directory", and a new constant was introduced
[quoted text clipped - 64 lines]
>>
>> Cheers, Rick
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.