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

On Tue, 10 May 2005 03:23:41 +0200, "Klaus Linke"
wrote:



"Kenneth" schrieb im Newsbeitrag ...
On Mon, 09 May 2005 17:40:47 -0400, Kenneth
wrote:


Howdy,

I have a routine in my database that writes a TXT file and
then calls a Word 2000 macro.

The macro simply formats the file and prints it a particular
way.

The problem is that I sometimes have upper ASCII (accented)
characters in the TXT file, and Word changes them to blanks.

With some experimentation, I have found that the problem is
in the conversion process. If I manually tell Word to format
the TXT file as "Plain Text" all is well.

I can solve my problem in two ways (that I can see.)

One would be if I can set Word to default to that formatting
for all TXT files.

The other would be if I can include in the macro some code
to specify that formatting.

Can you help with either?

Thanks,


Hello again,

In the hope that I could figure out how to enter the proper
conversion command in my macro, I just did it manually two
different ways with the Macro Recorder on.

I chose "Western European (Windows)" for Macro5, and
"Vietnamese (Windows) for Macro6.

To my surprise, the code generated by these two distinct
processes was identical:

Sub Macro5()
'
' Macro5 Macro
' Macro recorded 5/9/2005 by XXXXXXXX
'
Selection.InsertFile FileName:="ROSTER.TXT", Range:="",
ConfirmConversions _
:=False, Link:=False, Attachment:=False
End Sub

Sub Macro6()
'
' Macro6 Macro
' Macro recorded 5/9/2005 by XXXXXXXX
'
Selection.InsertFile FileName:="ROSTER.TXT", Range:="",
ConfirmConversions _
:=False, Link:=False, Attachment:=False
End Sub


Might you know the code to use the Western European
(Windows) conversion?

Sincere thanks,
--
Kenneth

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


Word2000 did this differently from newer versions, I think.
Maybe you can find some sample code if you look in the VBA help under .OpenEncoding and .SaveEncoding?

Regards,
Klaus



Hi Klaus,

I thank you for your suggestion, but (if I am interpreting
the helpfile properly) it seems that the command
..OpenEncoding returns the encoding, but does not set it.

All the best,
--
Kenneth

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