A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Mailmerge
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

merge with txt file need translation



 
 
Thread Tools Display Modes
  #1  
Old June 16th, 2005, 03:50 PM
Totoro
external usenet poster
 
Posts: n/a
Default merge with txt file need translation

Hi,
I'm working with soft who extract data in a txt file and launch word
and merge with this data txt file. This Txt file contain some
accentuated caracters.
everything is ok with Word 2000 but with Word 2002, only in particular
conditions, word automaticaly translate this file in japanese code so
the result of the merge is unreadable. It seems like it happend with
particular group of accentuated caracters because I have some extract
file with accentuated caracters correctly opened without translation.
In a other way, I have a txt file word wants to translate, I try to
manually operate the merge, word ask for translation, I cut this txt
file in some little txt files containing less than 9 records ... word
never ask to translate any of them ...

Any Ideas ??

thx a lot

--
A++
Laurent

"Tu sais que tu es comme le H de Hawaï ?"
"s't'a dire ?"
"Tu sers à rien, ch't'ai cassssééééé là !!"

  #2  
Old June 17th, 2005, 01:14 PM
Peter Jamieson
external usenet poster
 
Posts: n/a
Default

If you can create a text file that uses Unicode UTF-8 format, with a
suitable Unicode Byte Order Marker (BOM) , I /think/ Word will recognise the
file correctly, but it may still pop up an encoding dialog box.

The only other approach I know that /may/ solve this is to use some form of
automation to convert the source into a format that does work. For example,
use Word automation to open the file and save it as a Word document, then
use that as the data source for your merge. In this case you can specify the
encoding when you open the file.

If you convert to a Word .doc file, you may encounter performance problems
and (possibly) restrictions on the column count. But otherwise, that is
probably the best option.

To do the conversion, you need a simple macro, but you might need to do more
to cope with different file names and so on.

E.g.

Sub ConvertToUTF8()
' convert to a UTF8 format text file

' Needs error checking etc.
Dim oDoc as Word.Document

' change msoEncodingWestern to be the encoding you need. I think this should
work.

Set oDoc = Documents.Open("the path name of the file you need to
convert.txt", _
False, , False, , , , , , _
wdOpenFormatEncodedText, _
msoEncodingWestern, _
False, False, , True)

' Several of the parameters here are optional or
' irrelevant - you can probably remove the lines from
' ReadOnlyRecommended to SaveAsAOCLetter

oDoc.SaveAs _
FileName:="the path name of the file to convert to.txt", _
FileFormat:=wdFormatUnicodeTex*t, _
AddToRecentFiles:=False, _
ReadOnlyRecommended:=False, _
EmbedTrueTypeFonts:=False, _
SaveNativePictureFormat:=False*, _
SaveFormsData:=False, _
SaveAsAOCLetter:=False, _
Encoding:=msoEncodingUTF8, _
InsertLineBreaks:=False, _
AllowSubstitutions:=False, _
LineEnding:=wdCRLF

oDoc.Close Savechanges:=False
Set oDoc = Nothing
End Sub

or

Sub ConvertToWord()
' convert to a Word document file

' Needs error checking etc.
Dim oDoc as Word.Document

' change msoEncodingWestern to be the encoding you need. I think this should
work.

Set oDoc = Documents.Open("the path name of the file you need to
convert.txt", _
False, , False, , , , , , _
wdOpenFormatEncodedText, _
msoEncodingWestern, _
False, False, , True)

' Several of the parameters here are optional or
' irrelevant - you can probably remove the lines from
' ReadOnlyRecommended to Encoding

oDoc.SaveAs _
FileName:="the path name of the file to convert to.doc", _
FileFormat:=wdFormatDocument, _
AddToRecentFiles:=False, _
ReadOnlyRecommended:=False, _
EmbedTrueTypeFonts:=False, _
SaveNativePictureFormat:=False*, _
SaveFormsData:=False, _
SaveAsAOCLetter:=False, _
Encoding:=msoEncodingUTF8, _
InsertLineBreaks:=False, _
AllowSubstitutions:=False, _
LineEnding:=wdCRLF

oDoc.Close Savechanges:=False
Set oDoc = Nothing
End Sub

--

Peter Jamieson


"Totoro" wrote in message
...
Hi,
I'm working with soft who extract data in a txt file and launch word and
merge with this data txt file. This Txt file contain some accentuated
caracters.
everything is ok with Word 2000 but with Word 2002, only in particular
conditions, word automaticaly translate this file in japanese code so the
result of the merge is unreadable. It seems like it happend with
particular group of accentuated caracters because I have some extract file
with accentuated caracters correctly opened without translation. In a
other way, I have a txt file word wants to translate, I try to manually
operate the merge, word ask for translation, I cut this txt file in some
little txt files containing less than 9 records ... word never ask to
translate any of them ...

Any Ideas ??

thx a lot

--
A++
Laurent

"Tu sais que tu es comme le H de Hawaï ?"
"s't'a dire ?"
"Tu sers à rien, ch't'ai cassssééééé là !!"



  #3  
Old June 20th, 2005, 09:56 AM
Totoro
external usenet poster
 
Posts: n/a
Default

thx a lot for reply

i will try to force convertion in unicode format before opening word.

--
A++
Laurent

-Le Mordor Gandalf, c'est à droite ou à gauche?
- A gauche.

  #4  
Old June 22nd, 2005, 10:43 AM
Totoro
external usenet poster
 
Posts: n/a
Default

Totoro a utilisé son clavier pour écrire :
thx a lot for reply

i will try to force convertion in unicode format before opening word.


Ok, I force file conversion in UNICODE format before launching word ,
and now, Word is launching, the data files is attached and opened
correctly with word 2000, 2002, 2003.

--
A++
Laurent

In the Navy, yes, you can sail the seven seas.
In the Navy, yes, you can put your mind at ease.
In the Navy, come on now people, make a stand.
In the Navy, can't you see we need a hand.
In the Navy, come on, protect the motherland.
In the Navy, come on and join your fellow, man.
In the Navy, come on, people, and make a stand.
In the Navy, in the Navy.

  #5  
Old June 22nd, 2005, 06:12 PM
Peter Jamieson
external usenet poster
 
Posts: n/a
Default

OK, thanks for the feedback.

Peter Jamieson

"Totoro" wrote in message
...
Totoro a utilisé son clavier pour écrire :
thx a lot for reply

i will try to force convertion in unicode format before opening word.


Ok, I force file conversion in UNICODE format before launching word , and
now, Word is launching, the data files is attached and opened correctly
with word 2000, 2002, 2003.

--
A++
Laurent

In the Navy, yes, you can sail the seven seas.
In the Navy, yes, you can put your mind at ease.
In the Navy, come on now people, make a stand.
In the Navy, can't you see we need a hand.
In the Navy, come on, protect the motherland.
In the Navy, come on and join your fellow, man.
In the Navy, come on, people, and make a stand.
In the Navy, in the Navy.



  #6  
Old June 23rd, 2005, 11:38 AM
bilisa
external usenet poster
 
Posts: n/a
Default

How did you do that. I have the same problem I think..

"Totoro" wrote:

Totoro a utilisé son clavier pour écrire :
thx a lot for reply

i will try to force convertion in unicode format before opening word.


Ok, I force file conversion in UNICODE format before launching word ,
and now, Word is launching, the data files is attached and opened
correctly with word 2000, 2002, 2003.

--
A++
Laurent

In the Navy, yes, you can sail the seven seas.
In the Navy, yes, you can put your mind at ease.
In the Navy, come on now people, make a stand.
In the Navy, can't you see we need a hand.
In the Navy, come on, protect the motherland.
In the Navy, come on and join your fellow, man.
In the Navy, come on, people, and make a stand.
In the Navy, in the Navy.


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create relative and shorthand file path names 2dogs General Discussion 4 May 14th, 2005 08:49 PM
i read a thread one time that told me jim sturtz Fax 14 January 24th, 2005 11:11 PM
Jet35.sp3 doglover Database Design 3 August 26th, 2004 04:41 PM
Continual Error 1321 Trying to Install Office 2003 Chad Harris General Discussions 9 June 11th, 2004 08:19 AM
GPO Office 2003 Tony Setup, Installing & Configuration 1 May 12th, 2004 10:42 AM


All times are GMT +1. The time now is 02:55 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.