I am trying to access an element in a collection of styles of a dictionary document, I was wondering if there is a way to find out if an element with a given key exists without throwing an exception.
Now I am doing something like:
newStyle = _document.Styles.get_Item(ref styleName);
This works when an element exists, if it does not work (I know that I can use the try / catch block, but I would prefer not to.
thanks for the help
source
share