Hi Curls,
> I'm using the "Microsoft Word 9.0 Object Library" to
> interact with Word inside a WebService. I would like to
[quoted text clipped - 6 lines]
> a template, it returns also the structure of the template
> (like "\* MERGEFORMAT "). How can I get the plain text?
\* MergeFormat has nothing to do with a template. That would
be part of a field code. And I'm a bit at a loss why a field
code would be coming across when you request the .Text
property. But...
1. Declare a range variable and set it to the document
range. Roughly:
Dim rng as Word.Range = _app.Documents.Item(re one).Range
Then set the TextRetrievalMode to NOT include field codes:
rng.TextRetrievalMode.IncludeFieldCodes = False
See then if rng.Text returns something else than you're
currently getting.
Note: if you're gettin all kinds of weird things, such as
style names, double-check the file format being used to OPEN
the document. It's remotely possible that it's being opened
with "Recover text from any document".
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
http://www.mvps.org/word
http://go.compuserve.com/MSOfficeForum
This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:-)
curls - 10 Sep 2003 07:49 GMT
It works fine!
Thanks a lot Cindy!