I need to get the text between these 2 bookmarks, how do I do that?
Word.Document docActive = applicationObje ct.ActiveDocume nt;
object oFirstBookmark = "FirstBookmark" ;
Word.Range rngFirstBookmar k =
docActive.Bookm arks.get_Item(r ef oFirstBookmark) .Range;
object oSecondBookmark = "SecondBookmark ";
Word.Range rngSecondBookma rk =
docActive.Bookm arks.get_Item(r ef oSecondBookmark ).Range;
object firstBookmarkEn d = rngFirstBookmar k.End;
object secondBookmarkS tart = rngSecondBookma rk.Start;
Word.Range rngTarget =
docActive.Range (ref firstBookmarkEn d, ref secondBookmarkS tart);
string DesiredText = rngTarget.Text;
--
Bill Coan
bi******@wordsi te.com
920-779-9148
"Alan T" <al************ *@yahoo.com.auw rote in message
news:u8******** ******@TK2MSFTN GP04.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>