Trapping Errors Via Automation

  • Thread starter Thread starter Neil
  • Start date Start date
I wasn't clear on what was being referred to when you said, "if you look at
each font property." But I see now that you're referring to the font
property of each paragraph. That's a strange and interesting concept, being
able to see if the font changes in the paragraph. Thanks for the tip.
 
I'm not an XML expert, Neil, so I can't give much practical help. An XML
file is just a text file so it can be read in any number of ways,
although usually it's simplest to use an XML parser. As far as I know
Access 2003's XML capabilities aren't flexible enough for this and it
would be necessary to get some sort of add-in or library.

I'd hoped that you'd be able to rely on the fact that all the formatting
in an XML document is done with tags enclosed in <angle brackets>, while
the text is enclosed by the tags, e.g.
<tag>this is the text.</tag>
Hence any change in formatting is marked by a tag.

The complication is that when Word saves a document as XML it also uses
tags for many things that don't amount to a change in formatting in the
ordinary sense of the word, such as smart tags. This means it's not
sufficient just to look for text between tags, it's also (I guess,
though I don't know exactly what you're trying to do) necessary to
ignore tags that don't correspond to changes in formatting.

I hope this gives you enough to decide whether you should investigate
XML in more detail.


Would I be able to read the document in Access directly via an add-in, or
how would I read the documents?
 
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
Newsgroups: comp.databases.ms-access,microsoft.public.access,microsoft.public.access.interopoledde,microsoft.public.office.developer.automation,microsoft.public.officedev
NNTP-Posting-Host: 154.196.62.81.cust.bluewin.ch 81.62.196.154
Path: number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!msrtrans!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP14.phx.gbl
Lines: 1
Xref: number1.nntp.dca.giganews.com comp.databases.ms-access:821053 microsoft.public.access:174437 microsoft.public.access.interopoledde:10079 microsoft.public.office.developer.automation:9855 microsoft.public.officedev:15703

Hi Neil,
Would I be able to read the document in Access directly via an add-in, or
how would I read the documents?
The documents would be saved as plain text, so theoretically, they could be
opened in Notepad.

This means you could open them in Access same as any other text file and
process them (the old Open and Close commands). That would be one possibility
that's "built into" Office VBA.

Another could be to parse them using MSXML. In either case, though, you'd need
to contend with the WordProcessingML, which could be a real bear, depending on
what you really need to do.

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 :-)
 
Thanks for the note, Cindy. I like the idea of being able to open the files
directly via Open; but parsing through the XML doesn't look like fun. :-)
Either way, I'd still have to open Word via automation to save each file as
XML. So it seems that just continuing to parse it in Word via automation
might still be the best way.
 

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

Back
Top