Home All Groups Group Topic Archive Search About

ReplacePattern ExceptionSystem.AccessViolationException

Author
12 Oct 2006 11:24 AM
thartman
ReplacePattern throws: ExceptionSystem.AccessViolationException

if and only if
I replace a regExp with an emtpy string ("" or string.empty)

the code snipped:

Document curDoc = appObject.ActiveDocument;           
TextDocument textDoc = (TextDocument)curDoc.Object("TextDocument");         

TextRanges dummy = null;

EditPoint editPoint = (EditPoint)textDoc.EndPoint.CreateEditPoint();        
       textDoc.ReplacePattern("[\t]+$","",(int)vsFindOptions.vsFindOptionsRegularExpression, ref dummy);

Any ideas?

AddThis Social Bookmark Button