Conversion of "Plain Text"...?

K

Kenneth

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,
 
K

Kenneth

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,
 
K

Klaus Linke

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
 
K

Kenneth

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,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top