c# - Find out if item exists in Microsoft.Office.Interop.Word.Styles collection -
I'm trying to use an item on the collection of styles of a word document, I was wondering if anyone The way to know if an item with something is present without throwing an exception.
I am doing something like this now:
newStyle = _document.Styles.get_Item (ref styleName);
This works when the item exists, if it does not fail (I know that I can use an attempt / hold block, but I do not want to. < / P>
Thank you for your help
You need to loop on style and name it Check, and Exit Loop if you have a match.
Comments
Post a Comment