I need to get the text between these 2 bookmarks, how do I do that?
Word.Document docActive = applicationObject.ActiveDocument;
object oFirstBookmark = "FirstBookmark";
Word.Range rngFirstBookmark =
docActive.Bookmarks.get_Item(ref oFirstBookmark).Range;
object oSecondBookmark = "SecondBookmark";
Word.Range rngSecondBookmark =
docActive.Bookmarks.get_Item(ref oSecondBookmark).Range;
object firstBookmarkEnd = rngFirstBookmark.End;
object secondBookmarkStart = rngSecondBookmark.Start;
Word.Range rngTarget =
docActive.Range(ref firstBookmarkEnd, ref secondBookmarkStart);
string DesiredText = rngTarget.Text;
--
Bill Coan
bi******@wordsite.com
920-779-9148
"Alan T" <al*************@yahoo.com.auwrote in message
news:u8**************@TK2MSFTNGP04.phx.gbl...
>I have two bookmarks,
eg. beginMark and endMark
I need to get the text between these 2 bookmarks, how do I do that?
eg.
<beginMark>
Hello Word!
This is Saturday.
Now is Sunday.
<endMark>