I have a file that is generated from our accounting program and is saved as
an ASCII Dos Text file.

I need to use vba coding that tells Word to open it as an ASCII Dos Text
file. There are two different special characters in the txt file which
separates the fields and ends the records. When Word opens the txt file,
those characters import as just squares with no way to distinguish between
the end fields and the end records.

Brenda

RE: ASCII Dos Text by HelmutWeber

HelmutWeber
Thu Apr 10 06:03:01 PDT 2008

Hi Brenda,

you don't need special code to open a txt-file.

Documents.Add "c:\test\wh.txt"

is all you need.

To find out about the squares, select them and use
this code to find out, what characters they are.

Msgbox Asc(selection.text)

HTH

--
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Word 2002, Windows 2000 (german versions)




Re: ASCII Dos Text by Graham

Graham
Thu Apr 10 06:08:24 PDT 2008

You *may* find that the old Text with Layout converter, which you can
download from my web site will work (you need to ensure Word > Tools >
Options > General > Confirm conversion at open is checked in order to prompt
you to select that filter).

If that doesn't fix it, can you e-mail me a sample of the output to the link
on my web site so that we can see what we are dealing with.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


Brenda A. Reid wrote:
> I have a file that is generated from our accounting program and is
> saved as an ASCII Dos Text file.
>
> I need to use vba coding that tells Word to open it as an ASCII Dos
> Text file. There are two different special characters in the txt
> file which separates the fields and ends the records. When Word
> opens the txt file, those characters import as just squares with no
> way to distinguish between the end fields and the end records.
>
> Brenda