Automate the file conversion in word 2003

T

ttminh

Hi all,
Thanks in advance, i have a problem like that:

i have to work with a bundles of text file in Vietnamese characters
with file extension ".WST"
whenever i open that files, the file conversion dialog poping up and i
have to choose text encoding from Windows (default) and click OK.
I tried to record a AutoOpen Macro, but the macro only run after i have
to convert.

Could anyone help me to write a macro to do:

when open 1 file, if the file extension like ".WST" the macro force
winword to convert from "plain text"

Thank you.
Minh
 
G

Graham Mayor

Uncheck tools > options > general > confirm conversion at open and the file
should open directly, provided Word recognises the internal structure as
plain text which by choosing the default plain text it appears to. The
extension is not really the issue.

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
T

ttminh

Thanks Graham Mayor,
I did uncheck confirm conversion at open.
but when i open that file, the file conversion still pop up and the the
text encoding MS sugested is Japanese or something... and i still have
to click to choose.
any comment.

Best Regards,
Minh
 
P

Peter Jamieson

You can try a macro, e.g.

Sub OpenEncodedTextFile()

' Use your file path, and the appropriate encoding
Documents.Open _
FileName:="C:\mydocs\mydoc.", _
Format:=wdOpenFormatText, _
Encoding:=msoEncodingVietnamese

End Sub

Depending on the precise version of Word, you may also be affected by the
problem described in the following Knowledgebase articles. However, I doubt
if this is the case:

"The File Conversion Encoding dialog box appears when you open a text file"

http://support.microsoft.com/kb/290981/en-us

Peter Jamieson
 

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