View Single Post
 
Old 10-11-2018, 05:08 PM
kateabode kateabode is offline Windows 7 64bit Office 2016
Novice
 
Join Date: Sep 2018
Posts: 16
kateabode is on a distinguished road
Default

Quote:
Originally Posted by gmayor View Post
Use the following

Code:
On Error Resume Next
        If CheckBox1.Value = True Then
        Set RngSrc = DocSrc.Bookmarks("A").Range
        Set RngTgt = DocTgt.Bookmarks("A").Range
        RngTgt.FormattedText = RngSrc.FormattedText
        RngTgt.Bookmarks.Add "A"
    Else
        Set RngTgt = DocTgt.Bookmarks("A").Range
        RngTgt.Text = ""
        RngTgt.Bookmarks.Add "A"
    End If
Thanks for your response Greg, however this hasn't worked. It hasn't done anything I don't think. When I didn't select the checkbox corresponding to bookmark A, the bookmark remained in the activedocument.
I am hoping that if not selected then the bookmark will be deleted.
Basically I have a document with lots of bookmarks line after line on an empty page and if i don't check a lot of the bookmarks then there are a whole lot of spaces in the document from where the bookmarks are. I hope that makes sense.
Reply With Quote