Word 2003 XML documents as plain text (unicode)

F

FMAS

I write a macro to manipulate some tags in XML documents. In previous
versions of MS Word it wasn't a problem to insert XML-documents
automatically in plain text format.

How can I either set the MS-Word defaults in order not to have XML
documents opened as XML documents or

alter the following code to have the files inserted as plain text
(unicode) files?

Selection.InsertFile FileName:= myfile$, Range:="", _
ConfirmConversions:=False, Link:=False, Attachment:=False
(of course I want to avoid having to confirm each conversion manually)

Any help is much appreciated.

Francois
 
C

Cindy M -WordMVP-

Hi Fmas,

I think you'd need to make this a multi-step process:

1. Have the macro first open the file directly in Word. you can specify
the Format argument to wdOpenFormatText, which should open it as plain
text.

2. Now save this as a Word document and close it

3. Now you should be able to insert it into an existing Word document.
I write a macro to manipulate some tags in XML documents. In previous
versions of MS Word it wasn't a problem to insert XML-documents
automatically in plain text format.

How can I either set the MS-Word defaults in order not to have XML
documents opened as XML documents or

alter the following code to have the files inserted as plain text
(unicode) files?

Selection.InsertFile FileName:= myfile$, Range:="", _
ConfirmConversions:=False, Link:=False, Attachment:=False
(of course I want to avoid having to confirm each conversion manually)

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 

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