Thread: danish letters
View Single Post
  #4   Report Post  
Peter Jamieson
 
Posts: n/a
Default

It is something you have to have to use an ODBC (Open DataBase Connectivity)
data source.

Word can read a text data source using a number of different methods,
including
a. its own internal text converter
b. ODBC
c. OLEDB
d. indirectly, e.g. using Excel (the method you were using)

All these methods suffer from various problems, but in this case I believe
the ODBC method is most likely to work. However, it does require that you
have ODBC on your system, which I believe you will have by default. if you
do not, and you need to distribute your solution, other approaches begin to
look better, But to check, go into Windows Control Panel and look for
Performance and Maintenance|Administrative Tools|Data Sources (ODBC), or
just Administrative Tools|Data Sources (ODBC), and look in the User DSN tab
for "Delimited Text Files". if you do not see it, click Add, find Microsoft
Text Driver, fill in the details, and take it from there.


Peter Jamieson

"bilisa" wrote in message
...
This may sound as a stupid question: What is Text Driver DSN on system?

"Peter Jamieson" wrote:

I suggest you try the following instead, but use the pathname of the
folder
containing your text file instead of "c:\myfiles", and if necessary,
change
the name of the ODBC DSN in the connection parameter to match the name of
a
Text Driver DSN on your system.

..OpenDataSource _
Name:=filnavn, _
Connection:="DSN=Delimited Text
Files;DBQ=c:\myfiles;DriverId=27;FIL=text;MaxBuffe rSize=2048;PageTimeout=5;",
_
SQLStatement:="SELECT * FROM " & filnavn

Peter Jamieson

"bilisa" wrote in message
...
Hi

Im having problems when I merge my document / template with a .csv data
source. My data source is already attached to the template via some vba
script. I have some translation problems when the data posts contain
danish
letters as Ø,ø,æ,Æ,å, Å. Some times they disappear and sometimes they
turn
into asian symbols in the merged letter. They open correctly in Excel
but
are
not displayed correctly in the merged letter.

This is my code:

Dim myheader As String

filnavn = "C:\FLETFIL.CSV"

With ActiveDocument.MailMerge

.MainDocumentType = wdFormLetters

.OpenDataSource _
Name:=filnavn, _
Connection:="Entire Spreadsheet", _
SubType:=wdMergeSubTypeWord2000

' Do it
.Destination = wdSendToNewDocument
.Execute
End With

What is wrong with it? Any help is appreciated.

Yours sincerely