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 / July 2005

Tip: Looking for answers? Try searching our database.

Probleme mit VB6 und MailMerge in Word 97

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ralf Dreckmann - 25 Jul 2005 17:34 GMT
Folgender Sachverhalt:
Eine VB6 Anwendung erstellt eine Datendatei und baut dann via Word ein
Dokument zusammen. Abschließend wird das Dokument und die Datendatei zu einem
Serienbrief zusammengefasst. Dies funktioniert einwandfrei bei Word 2000 und
höher - allerdings bei einigen anwendern nicht, wenn Word 97 im Spiel ist. In
diesen Fällen wird bei dem Zusammenmischen des Dokuments und der Daten immer
darauf verwiesen, dass die Daten des Dokuments nicht in der Datendatei
enthalten sind - was natürlich falsch ist, den die Daten sind definitiv
vorhanden.

Hat irgendwer eine Idee, was dies sein könnte - ich verzweifle langsam an
diesem Problem ...

Danke!
Peter Jamieson - 25 Jul 2005 18:16 GMT
What format is the data file? .txt? .csv? etc. If it is a .txt file, what
field delimiter and record delimiter are you using?

Also, if you do the merge manually in Word 97 using the same data file, does
the merge work, or do you see the same error?

Are you calling an OpenDataSource method? If so, what are the parameters? If
not, can you tell us the values of
(the document object).ActiveDocument.Mailmerge.DataSource.Name
(the document object).ActiveDocument.Mailmerge.DataSource.QueryString
(the document object).ActiveDocument.Mailmerge.DataSource.ConnectString

Peter Jamieson

If it is a delimited format such as .txt, there can be a problem because in
some cases Word uses an internal converter to read the file, and in other
cases it uses ODBC.
> Folgender Sachverhalt:
> Eine VB6 Anwendung erstellt eine Datendatei und baut dann via Word ein
[quoted text clipped - 14 lines]
>
> Danke!
Ralf Dreckmann - 25 Jul 2005 21:26 GMT
Hi Peter,

a) It is a *.txt file

b) Example for such an txt-file:
"Dokumentnummer","User","UKurzzeichen","UTelefon","UTelefax","UEMail","Unternehmensart","IDBeduerftiger","IDPfleger","IDBeziehung","IDTatsaechlichePflege","OB1","OB2","Rentenversicherungsnummer","IDPflegerExtern","Geschlecht","Zuname","Vorname","Titel","Vorsatzwort","Strasse","Hausnummer","Land","PLZ","Wohnort","AntragVom","Ablehnungsgrund","AblehnungAb","BedGeschlecht","BedVorname","BedZuname","BedTitel","BedVorsatzwort","Amt","Betreuung"
2,"Admin","Adm","+49 700 salutaris","+49 69
791237770","SoSiP@salutaris.com",1,533,620,749,1084,"583488CK5703","0100/PVN","42041041L503","","2","Pfleger620","Renate","","","Pflegerstraße","620","","50000","Köln","9.5.2004","14","23.3.2004","1","Günter","Bedürftiger533","","","",""

c) I don't see it - only some users; this problem does not exists at the
development PC's.

d) See this coding:
       With mobjWordDocument.MailMerge
           .MainDocumentType = wdFormLetters
           .OpenDataSource Name:=gsWWUserdatei, Format:=wdOpenFormatText,
ConfirmConversions:=True, ReadOnly:=True
           .Destination = wdSendToNewDocument
           .Execute (True)
       End With

We thought, that "Format:=wdOpenFormatText, ConfirmConversions:=True," could
solve this problem - but it don't.

Some ideas?!?

Ralf

> What format is the data file? .txt? .csv? etc. If it is a .txt file, what
> field delimiter and record delimiter are you using?
[quoted text clipped - 31 lines]
> >
> > Danke!
Peter Jamieson - 25 Jul 2005 21:57 GMT
Hi Ralf

One possible problem is that Word can use two different mechanisms to
connect to .txt data
(1) its internal text converter
(2) ODBC

In some cases Word will try to use ODBC even when you do not specify it in
the OpenDataSource call, and in those cases it can fail.

If you can use one of the machines that fails to test changes, I would
consider the following:
a. Determine whether ODBC is installed on that machine, whether the Text
Driver is installed, and whether there is  a Text DSN.
b. try changing the .txt file extension to .dat or
c. use the ODBC administrator to set up a schema.ini file that specifies
that the file is comma-delimited with a header line (if necessary you can
try this on your own system, see the schema.ini that is created, edit it in
notepad and copy it to the test machine)

> We thought, that "Format:=wdOpenFormatText, ConfirmConversions:=True,"
> could
> solve this problem - but it don't.

Many of the parameters to OpenDataSource do not do anything at all in most
cases, even when they sound as if they should. Usually, only Name,
Connection, SQLStatement, SQLStatement1, and in Word 2002/2003, Subtype
actually have any impact.

Peter Jamieson

> Hi Peter,
>
[quoted text clipped - 66 lines]
>> >
>> > Danke!
Ralf Dreckmann - 26 Jul 2005 07:42 GMT
Hi Peter,

thanks for the hints. I will try them and come back later ....

Ralf

> Hi Ralf
>
[quoted text clipped - 97 lines]
> >> >
> >> > Danke!
Ralf Dreckmann - 28 Jul 2005 18:27 GMT
Hi Peter,

this was the right tip. The result is:
a) when the ODBC-Driver for the txt-file (who will use this?) is erased - it
works!
b) when the data-file is not named as a txt-file - it works, also when the
ODBC-Driver is installed.

Thanks a lot
Ralf

> Hi Ralf
>
[quoted text clipped - 97 lines]
> >> >
> >> > Danke!

Rate this thread:






 
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.