
The exception pops up on the ShowDialog so it looks as if it is some code being called implicitly, rather than something my code does directly.
Here are the exception details, such as they are:
System.ArgumentException occurred
Message=Both versions must reference the same ITextDocument.
Source=ActiproSoftware.Text.Net351
StackTrace:
at ActiproSoftware.Text.TextRange.a(ITextVersion A_0, ITextVersion A_1, TextRangeTrackingModes A_2, Boolean A_3)
InnerException: null