lesaussice
08-01-2013, 05:38 AM
I have an issue with Find in a sizeable Word application whereby Word returns a 5692 error in certain circumstances if using a wildcard.
The search string that causes an exception is checking specific paragraphs for the presence of anything other than an image (^g), a manual carriage return (^m) or a paragraph mark (^13) and so is expressed as [!^13^g^m]. I think it's the ^g which is causing the problem.
The code looks to run on Word 2003 without a problem, but causes a 5692 on Word 2010 or 2013 (I haven't tested it on 2007 yet). Simply trapping and ignoring the error isn't really an option - I need a workaround that will provide equivalent output.
The search string that causes an exception is checking specific paragraphs for the presence of anything other than an image (^g), a manual carriage return (^m) or a paragraph mark (^13) and so is expressed as [!^13^g^m]. I think it's the ^g which is causing the problem.
The code looks to run on Word 2003 without a problem, but causes a 5692 on Word 2010 or 2013 (I haven't tested it on 2007 yet). Simply trapping and ignoring the error isn't really an option - I need a workaround that will provide equivalent output.