I have this code and i want it only to delete the content within the bookmark not the bookmark it self,
could anyone help me please:
Public Sub Deletebookmark(strBookmark As String, chkResult As Boolean)
'Delete choosen bookmark
If chkResult = False Then
And it gets call by this:
Deletebookmark "test", CheckBox14.Value ' Test BM
I have this code which works for me to replace content within the bookmark.
Sub InsertBookmark(strBookmark As String, TextToUse As String)
'Insert text into bookmark without deleting
Dim BMRange As Range
Set BMRange = ActiveDocument.Bookmarks(strBookmark).Range
BMRange.Text = TextToUse
If Len(strBookmark) > 0 Then ActiveDocument.Bookmarks.Add strBookmark, BMRange
What i want to achive is basically add a placeholder so i can add/remove Buildingblock/quickpart without the bookmarks getting deleted.. is this possible?
I have alot of bits of code i just need some help with doing it right i guess..
How i add the Building block is like this:
If CheckBox24 = True Then ' insert BM
Set tmpl = ActiveDocument.AttachedTemplate
I can really figur out how to use the "InsertBookmark" sub with the buildingblock insert
I still learning VBA on my own so please bare with me...
Thank you in advance