How does one open a XML document as plain text in Office 2003

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

This is probably a very dumb question, but I want to be able to open up an XML document as plain text (that is, so I can see the tag delimiters <>). I want to write a macro to do some conversions. A workaround is to save the original XML document with a different file extension (for example, .txt), and then open it in Word, but I'd like to avoid that.
 
You can open the XML file with IE, then go to the View
menu and select "Source". This displays the XML data in
Notepad, from which you can edit the data directly. If
you change something there and save it, then go back to
IE and click Refresh, you will see your changes displayed
(or an XML error message if you messed up the data
structure).

Hope that's what you're after.
 
Thanks for the reply, but that's not what I'm after. I want to bring the file into Word so that I can run some macros against it to manipulate the tags. The problem seems to be that Word wants to treat an xml file as an xml file, so it doesn't display the tags as text, and the macro therefore doesn't find the text to change it.
 
Confused said:
Thanks for the reply, but that's not what I'm after. I want to bring the file into Word so that I can run some macros against it to manipulate the tags. The problem seems to be that Word wants to treat an xml file as an xml file, so it doesn't display the tags as text, and the macro therefore doesn't find the text to change it.

Suggest you open the file in Notepad, Wordpad, or other editor.
Select/Copy all into the clipboard, then paste/special as "unformatted
text" into Word.
 
Hi =?Utf-8?B?Q29uZnVzZWQ=?=,
This is probably a very dumb question, but I want to be able to open up an XML document as plain text (that is, so I can see the tag delimiters <>). I want to write a macro to do some conversions. A workaround is to save the original XML document with a different file extension (for example, .txt), and then open it in Word, but I'd like to avoid that.
Just specify to open it as plain text. Are you trying to open it in the UI, or using VBA?

In the UI: Tools/OPtions/General and activate "Confirm conversions on open".

For VBA: see the information for the Format argument of the Open method.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.mvps.org/word

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