Home All Groups Group Topic Archive Search About
Author
14 Oct 2005 1:58 PM
Moose
Hi guys,

is there anyway to embed a word document in a VB application? or to set the
encoding of a richtext object to accept Western European (dos) encoded text?

Situation is -
We have an old database that outputs raw text in this format,  if i open
them in Word i can select to open them using the Western Euro dos encoding
and the thing looks fine, but i have a few of these and need to automate the
whole process. Thing is when i read the file into VB using a rich text box
as a holder i get lots of gibberish characters since the encoding is wrong.
:o(

Any one have any idea how i can get VB to display the text correctly?

Author
16 Oct 2005 7:53 AM
Mark Yudkin
To embed a Word document, use the OLE object.

To specify the character set on insertion, send an EM_SETTEXTEX message
setting the desired codepage in the SETTEXTEX.codepage member passed via
WPARAM.

The simplest solution to the problem is to convert the string in your
application by calling OemToChar[Buff].

Show quoteHide quote
"Moose" <mo***@a.pc> wrote in message
news:434fb996$0$29102$ed2619ec@ptn-nntp-reader01.plus.net...
> Hi guys,
>
> is there anyway to embed a word document in a VB application? or to set
> the encoding of a richtext object to accept Western European (dos) encoded
> text?
>
> Situation is -
> We have an old database that outputs raw text in this format,  if i open
> them in Word i can select to open them using the Western Euro dos encoding
> and the thing looks fine, but i have a few of these and need to automate
> the whole process. Thing is when i read the file into VB using a rich text
> box as a holder i get lots of gibberish characters since the encoding is
> wrong. :o(
>
> Any one have any idea how i can get VB to display the text correctly?
>
>
>
>