This project has moved and is read-only. For the latest updates, please go here.

Word bookmark update

Aug 2, 2013 at 1:11 PM
hello con someone tell me why I can't change bookmarks this way:
        Word.Application oWord = new Word.Application();
        Word.Document oWordDoc = new Word.Document();
        if (oWordDoc.Bookmarks.Exists("name"))
        {
            object oBookMark = "name";
            oWordDoc.Bookmarks.get_Item(ref oBookMark).Range.Text = textBox1.Text;
        }
there's an error on: get_Item

Thanks in advance
Aug 2, 2013 at 5:21 PM
works this for you?

oWordDoc.Bookmarks["name"].Range.Text
Aug 2, 2013 at 6:33 PM
Yes dude!!! Thanks a lot!
Even if usually I use mergefield I wanted to know how to deal with bookmarks too.

Thanks again