A
aehan
Hello everyone
I'm struggling and need to ask for some help. It's probably really simple,
but my brain is not coping well at all.
I have a template which deletes/retains logos according to choices made from
a user form. It's working really well, except for one scenario and that is:
I want to delete the shapes where the criteria from one list box is met, and
the criteria from the others is not. And I've reached a mental block! The
code should be something like the "opposite" of the code below, in other
words I want to delete the logos if the text in the Combo2 box is anything
other than HR, Sales & Marketing or Product Control. Can anyone point me in
the right direction please?
Thanks for your help
Aehan
With ActiveDocument.Bookmarks("Combo1").Range
If InStr(.text, "Department 1") Then
With ActiveDocument.Bookmarks("Combo2").Range
If InStr(.text, "HR") Or InStr(.text, "Sales & Marketing")
Or _
InStr(.text, "Product Control") Then
ActiveWindow.ActivePane.View.SeekView =
wdSeekCurrentPageHeader
With Selection.HeaderFooter
.Shapes("HR Logo").Delete
.Shapes("SM Logo").Delete
.Shapes("PC Logo").Delete
End With
End If
End With
End If
End With
I'm struggling and need to ask for some help. It's probably really simple,
but my brain is not coping well at all.
I have a template which deletes/retains logos according to choices made from
a user form. It's working really well, except for one scenario and that is:
I want to delete the shapes where the criteria from one list box is met, and
the criteria from the others is not. And I've reached a mental block! The
code should be something like the "opposite" of the code below, in other
words I want to delete the logos if the text in the Combo2 box is anything
other than HR, Sales & Marketing or Product Control. Can anyone point me in
the right direction please?
Thanks for your help
Aehan
With ActiveDocument.Bookmarks("Combo1").Range
If InStr(.text, "Department 1") Then
With ActiveDocument.Bookmarks("Combo2").Range
If InStr(.text, "HR") Or InStr(.text, "Sales & Marketing")
Or _
InStr(.text, "Product Control") Then
ActiveWindow.ActivePane.View.SeekView =
wdSeekCurrentPageHeader
With Selection.HeaderFooter
.Shapes("HR Logo").Delete
.Shapes("SM Logo").Delete
.Shapes("PC Logo").Delete
End With
End If
End With
End If
End With