View Single Post
  #16   Report Post  
Kenneth
 
Posts: n/a
Default

On Wed, 11 May 2005 03:02:33 +0200, "Klaus Linke"
wrote:

Hi Kenneth,

The Encoding was meant to be used in the macro from the KB article:

' Replace the FileName example with the path to your text file.
Documents.Open FileName:="Z:\data\ROSTER.TXT", _
Format:=wdOpenFormatText, Encoding:=msoEncodingWestern

As there doesn't seem to be a way to specify the encoding for InsertFile, I'd open the text file as a new document with the code above, and then copy/paste it into your document.

The code you posted (re HKEY_LOCAL_MACHINE) is from the EditConversionOptions macro (support9.dot)?
I don't think you need that.

If it's not confidential, you might mail the text file to my private mail address, so I can experiment a bit.
Probably Word (Insert File) tries to guess the encoding from the characters used in the text file, and is thrown off by some unusual characters in the text file.

Using the method you described, I see that Word is using
code page 1200 when I open the TXT file, so that is no doubt
the source of the problem I am having. Why might that be
happening?


1200 is for Unicode and usual for a Word doc. I guess you used "Insert File", not "File Open"?
Then 1200 isn't surprising.

Regards,
Klaus


Hi again Klaus,

The problem is solved thanks to your kind help!!

Documents.Open FileName:="Z:\data\ROSTER.TXT", _
Format:=wdOpenFormatText, Encoding:=msoEncodingWestern

fixed the problem...

One question though:

What is the " _ " character that appears at the end of the
first line?

I will also add that I may have confused things when I
mentioned the issue of inserting (rather than opening) the
file.

I had added that only because I thought that it might help
in diagnosing the problem. I have no need to actually do
this by inserting. The modified macro now works perfectly by
opening the file.

Sincere thanks yet again,
--
Kenneth

If you email... Please remove the "SPAMLESS."