I have a VSTO add-in that is able to match against specific codes in the body of a document. The codes themselves are just strings that I syntactically match for validation.
My parsing using StoryRange works fine, but of course, I get the rare exception where a user is doing something funky in their document. I've noticed that some users are introducing bookmarks into the middle of the code string and this throws off my validation match. Instead of of code being '34-RD-345', when you reveal the hidden formatting in Office 2007, you will see something like '34-RID-345'. The bookmark formatting looks similiar to an uppercase i (I) and I can see that a bookmark is present using the bookmark option in the ribbon.
Does anyone know how I might be able to ignore the bookmark when I'm scanning the text?
Maybe an even better alternative maybe to just confine my parsing to [a-Z][0-9]. Is something like that possible?