Hi all,
i try to get a vba code to show or hide all images in my word document.
maybe accessible through a box that you can click or an assigned button.
thanks for your help u guys. much appreciated.
greets
Hi all,
i try to get a vba code to show or hide all images in my word document.
maybe accessible through a box that you can click or an assigned button.
thanks for your help u guys. much appreciated.
greets
Is it maybe an option to loop through all bookmarked images in the document to hide/show them? The first picture should stay in it.
This is a code that at least works for one bookmarked picture.
Dim boolhidden As Boolean
If ActiveWindow.View.ShowHiddenText = True Then
boolhidden = True
Else
boolhidden = False
End If
If boolhidden = True Then
ActiveWindow.View.ShowHiddenText = False
End If
With ActiveDocument.Bookmarks("Picture1").Range.Font
If .Hidden = True Then
.Hidden = False
Else
.Hidden = True
If boolhidden = True Then
ActiveWindow.View.ShowHiddenText = True
End If
End If
End With
Thanks in advance
Try:
To unhide, simply change the two False statements to TrueSub Demo() Dim Shp As Shape, iShp As InlineShape With ActiveDocument For Each iShp In .InlineShapes iShp.Range.Font.Hidden = True Next For Each Shp In .Shapes Shp.Anchor.Font.Hidden = True Next End With End Sub
Note: whether the images remain visible, or print, depends on how the user has Word configured.
Cheers
Paul Edstein
[Fmr MS MVP - Word]
Thanks a lot mate, it worked. priceless.
Best regards