Re: Please help:need to read XML, edit, and write back to XML file
- From: "Steve Yandl" <syandl_nospam@xxxxxxxxxxx>
- Date: Thu, 15 Nov 2007 15:19:56 -0800
Ed,
If you were only looking for a few tags, it would be simple enough to parse
out the text strings in a VBA routine using InStr and Mid functions but I
gather you're dealing with a more complex scenario.
Try doing a web search using the term
MSXML2.DOMDocument
and I think you may find some helpful links with examples of using that
object within VBA.
Steve
"Ed from AZ" <prof_ofwhat@xxxxxxxxx> wrote in message
news:65d2f8aa-9dbc-46fb-ad3e-c57bd7019b8e@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I'm using Word 2003. I use a proprietary Java program that takes all
the information in the various forms and generates an XML file. There
are times I need to move information between files. I tried to
explore this in the Excel and Access NG, because the data format would
lend itself very well to a spread*** or table. But I reached a dead
end.
My thought is to create a macro that would find the proper tags and
parse out all the data in between the correct tags into a table or
spread***. Then, after I have cut / pasted / mutilated the data as
required, I can write the new data back into an array, append the
correct tags, and write it back into the original XML file.
One problem is that when I open an XML file in Word 2003, I see on
screen the cute little visual representations of the tags - but they
aren't really there. At least, they don't show up in Print Preview,
and Paragraph.Range.Text doesn't see them. I found a clue in one NG
post and opened the Script Editor (ALT + SHIFT + F11), and saw tags
and much more. But I still have no idea how to accomplish what seems
to be the simple project of writing out the data from certain tags and
then writing it back when I'm done.
Can anyone please drop-kick me in a good direction to get started
towards this?
Ed
.
- Follow-Ups:
- Re: Please help:need to read XML, edit, and write back to XML file
- From: Ed from AZ
- Re: Please help:need to read XML, edit, and write back to XML file
- References:
- Please help:need to read XML, edit, and write back to XML file
- From: Ed from AZ
- Please help:need to read XML, edit, and write back to XML file
- Prev by Date: Re: Creating a hyperlinked document based on folder contects
- Next by Date: Re: Please help:need to read XML, edit, and write back to XML file
- Previous by thread: Please help:need to read XML, edit, and write back to XML file
- Next by thread: Re: Please help:need to read XML, edit, and write back to XML file
- Index(es):