Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Conversion of "Plain Text"...?
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, -- Kenneth If you email... Please remove the "SPAMLESS." |
#2
|
|||
|
|||
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." |
#3
|
|||
|
|||
Word2000 did this differently from newer versions, I think.=20
Maybe you can find some sample code if you look in the VBA help under = ..OpenEncoding and .SaveEncoding? Regards, Klaus "Kenneth" schrieb im Newsbeitrag = ... On Mon, 09 May 2005 17:40:47 -0400, Kenneth wrote: =20 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, =20 Hello again, =20 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. =20 I chose "Western European (Windows)" for Macro5, and "Vietnamese (Windows) for Macro6. =20 To my surprise, the code generated by these two distinct processes was identical: =20 Sub Macro5() ' ' Macro5 Macro ' Macro recorded 5/9/2005 by XXXXXXXX ' Selection.InsertFile FileName:=3D"ROSTER.TXT", Range:=3D"", ConfirmConversions _ :=3DFalse, Link:=3DFalse, Attachment:=3DFalse End Sub =20 Sub Macro6() ' ' Macro6 Macro ' Macro recorded 5/9/2005 by XXXXXXXX ' Selection.InsertFile FileName:=3D"ROSTER.TXT", Range:=3D"", ConfirmConversions _ :=3DFalse, Link:=3DFalse, Attachment:=3DFalse End Sub =20 =20 Might you know the code to use the Western European (Windows) conversion? =20 Sincere thanks, --=20 Kenneth =20 If you email... Please remove the "SPAMLESS." |
#4
|
|||
|
|||
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." |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can I easily create a tab-delimited file from plain text in Word? | Microsoft Word Help | |||
Plain text formatting entire document | Formatting Long Documents | |||
Numbers to appear at the cursor... | New Users | |||
Vba for 'Field to plain text' [Shift][Ctrl][F9] | Mailmerge | |||
Outline | Page Layout |