Hi,

I have a problem in a macro Word 2010.
I have 10 bookmarks in my word document and I protect it for permit only the modules compilation.
But two bookmarks are regenerated with a barcode image from the values of other bookmarks.
For the first time it's all ok, because the bookmarks are empty and I use
.InlineShapes.AddPicture
but when I use
.InlineShapes.Delete
for the macro stopped because the document is protect.
If I protect the document and I release the areas of every bookmarks not start the module compilation...
Can You help me?
Thanks

This is a part of code:

m = 0
strCommon = "C:\BCimage.png"
With ActiveDocument
Dim WrdPic As Word.InlineShape
For Each WrdPic In .InlineShapes
WrdPic.Delete
Next WrdPic
'Initializing the variables
For j = 2 To 1 Step -1

'This is where the name for the current image name is created and also the bookmark name
m = m + 1
BmkNm = "bc" & m

'Loading the images in the document
If .Bookmarks.Exists(BmkNm) Then
Set BmkRng = .Bookmarks(BmkNm).Range
With BmkRng
Set WrdPic = .InlineShapes.AddPicture(strCommon, False, True)
With WrdPic
.ScaleHeight = 50
End With
End With
.Bookmarks.Add BmkNm, BmkRng
End If
Next
End With
Set BmkRng = Nothing