2
282
Guest
Hi, I try to write in a Bookmark in MS-Word, but after I've written in a bookmark, the bookmark is removed. I can not find the right 4GL code for this I just find VSB code. Sub InsertInBookmarkI() Dim oRng As Word.Range Set oRng = ActiveDocument.Bookmarks("bmInBookmark").Range oRng.Text = ActiveDocument.Bookmarks("bmInBookmark").Range.Text & "Some text here." ActiveDocument.Bookmarks.Add "bmInBookmark", oRng lbl_Exit: Exit Sub End Sub Sub InsertInBookmarkII() Dim oRng As Word.Range Set oRng = ActiveDocument.Bookmarks("bmInBookmark").Range oRng.Text = ActiveDocument.Bookmarks("bmInBookmark").Range.Text & "Some more text here." ActiveDocument.Bookmarks.Add "bmInBookmark", oRng lbl_Exit: Exit Sub or Sub UpdateBookmark(BookmarkToUpdate As String, TextToUse As String) Dim BMRange As Range Set BMRange = ActiveDocument.Bookmarks(BookmarkToUpdate).Range BMRange.Text = TextToUse ActiveDocument.Bookmarks.Add BookmarkToUpdate, BMRange End Sub
Continue reading...
Continue reading...