J
Jens Gyldenkærne Clausen
Hi group. I'm trying to write an AddIn capable of replacing highlighted
text with contentcontrols. For the moment my concern is to find the
code that can find the highligted ranges and return them (as a
collection or list). Here I've found two specific problems:
a) How do I return the found Range from
Microsoft.Office.Interop.Word.Find.Execute? I can't just make an
automated replace, since the user needs to be able to correct or
override every replacement. The Find.Execute method returns a boolean
value to indicate IF the search was successfull (and the Find.Found
property gives the same information for multiple matches) - but I am
looking for the actual Range that the Find operation finds. How do I
retrieve that?
b) How do I search for highligted text (or rather - what integer value
corresponds to True in the property Find.Highlight)? I find it very
strange that the documentation mentions that "This property returns
True if highlight formatting is included in the find criteria. Can
return or be set to True, False, or wdUndefined."
(
http://msdn.microsoft.com/da-dk/library/microsoft.office.interop.word.find.highlight(en-us).aspx
) - but the type of the property is Integer, not a specific enumeration
exposing the three possible values.
Regards
text with contentcontrols. For the moment my concern is to find the
code that can find the highligted ranges and return them (as a
collection or list). Here I've found two specific problems:
a) How do I return the found Range from
Microsoft.Office.Interop.Word.Find.Execute? I can't just make an
automated replace, since the user needs to be able to correct or
override every replacement. The Find.Execute method returns a boolean
value to indicate IF the search was successfull (and the Find.Found
property gives the same information for multiple matches) - but I am
looking for the actual Range that the Find operation finds. How do I
retrieve that?
b) How do I search for highligted text (or rather - what integer value
corresponds to True in the property Find.Highlight)? I find it very
strange that the documentation mentions that "This property returns
True if highlight formatting is included in the find criteria. Can
return or be set to True, False, or wdUndefined."
(
http://msdn.microsoft.com/da-dk/library/microsoft.office.interop.word.find.highlight(en-us).aspx
) - but the type of the property is Integer, not a specific enumeration
exposing the three possible values.
Regards