txt-file is in ANSI format or OEM Character format.

J

Joergen Bondesen

Hi NG.

Is it possibel, in VBA, to know if a txt-file is in ANSI format or OEM
Character format.

Is this possible to save a txt-file (ANSI format) to OEM Character format.
 
J

Joel

I think the only real difference is the end of the lines being a "carriage
return" or "carriage return and line feed". It is pretty easy to convert a
file from one to the other format.
 
J

Joergen Bondesen

Hi Joel.

Thanks for your reply.
I think the only real difference is the end of the lines being a "carriage
return" or "carriage return and line feed".
That is not quite correct. In Denmark we have local letters as æ, ø and å
and therefore I have to change from ANSI to OEM when I am using data in
"old" industrial ink printers.
It is pretty easy to convert a file from one to the other format.

Do you have vba code for both purpose?
 
J

Joel

Now I understand the problem. Have you saved the file as CSV file or other
Text formats. What happens?

to fully understand what is happening you need to save the file and then
open the file with Notepad or some other text editor. Also try printing some
of the text files and see what happends.

The older printers have a smaller character set (number of characters) it
recognizes. When you use excel or other microsoft products such as word you
are using the OEM character set to be compatible with the printer.

You are actually changing the Font and not the word. The font setting are
invisible formatting characters just like Bold setting or color settings.
when you save the file as text all the formating characters are removed.
The solution in word would be to save the file as RTF which keeps the
formating.

You could try copying the file to word and then save the File as RTF.
 
J

Joergen Bondesen

Hi Joel.
Another solution if UltraEdit (Hex-editor) supports a scripting language
is
to automatically start the Ultraeditor from excel so the conversion is
automatic.
I will try this solution.

Thanks for your time.

Perhaps, I will be back, later.
 

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