mike009
06-18-2009, 05:23 AM
I have 3 book marks A, B and C
A = Empty
B and C = contain hidden images
when user chooses for company B, i copy B to A --> works OK
when user modify and choose for C, I DELETE useng myRang.delte, then copy C to A --> works OK
now for the third time, if user decide to modify , i got error that A has been deleted??
here is similar code
If ActiveDocument.Bookmarks.Exists("A") Then
Dim myRange As Range
Set myRange = ActiveDocument.Bookmarks("A").Range
Else
MsgBox "ERROR, bookmark has been delteed"
End If
HideLogos 'Methode to hide logos B and C
myRange.Delete
Select Case Me.cboCompany.Value
Case "B"
'ActiveDocument.CustomDocumentProperties("Company") = "B"
With ActiveDocument.Bookmarks("A").Range.InlineShapes(1)
.Width = logoFirstPageWidth
.LockAspectRatio = msoFalse
.Height = logoFirstPageHeight
.PictureFormat.Brightness = 0.5
.PictureFormat.Contrast = 0.5
.Range.Copy
End With
myRange.Paste
HideLogos
Case "C"
'ActiveDocument.CustomDocumentProperties("Company") = C"
With ActiveDocument.Bookmarks("A").Range.InlineShapes(1)
.Width = logoFirstPageWidth
.LockAspectRatio = msoFalse
.Height = logoFirstPageHeight
.PictureFormat.Brightness = 0.5
.PictureFormat.Contrast = 0.5
.Range.Copy
End With
myRange.Paste
HideLogos
End Select
A = Empty
B and C = contain hidden images
when user chooses for company B, i copy B to A --> works OK
when user modify and choose for C, I DELETE useng myRang.delte, then copy C to A --> works OK
now for the third time, if user decide to modify , i got error that A has been deleted??
here is similar code
If ActiveDocument.Bookmarks.Exists("A") Then
Dim myRange As Range
Set myRange = ActiveDocument.Bookmarks("A").Range
Else
MsgBox "ERROR, bookmark has been delteed"
End If
HideLogos 'Methode to hide logos B and C
myRange.Delete
Select Case Me.cboCompany.Value
Case "B"
'ActiveDocument.CustomDocumentProperties("Company") = "B"
With ActiveDocument.Bookmarks("A").Range.InlineShapes(1)
.Width = logoFirstPageWidth
.LockAspectRatio = msoFalse
.Height = logoFirstPageHeight
.PictureFormat.Brightness = 0.5
.PictureFormat.Contrast = 0.5
.Range.Copy
End With
myRange.Paste
HideLogos
Case "C"
'ActiveDocument.CustomDocumentProperties("Company") = C"
With ActiveDocument.Bookmarks("A").Range.InlineShapes(1)
.Width = logoFirstPageWidth
.LockAspectRatio = msoFalse
.Height = logoFirstPageHeight
.PictureFormat.Brightness = 0.5
.PictureFormat.Contrast = 0.5
.Range.Copy
End With
myRange.Paste
HideLogos
End Select