Problems with Shapes Properties

B

Brian Gilbert

Hi.

We have existing VBA code (created by someone else) that lets users switch
between two graphics in a Word doc. We now need to replace one of the
graphics but are having problems. The code uses a couple of lines in several
If statements to determine which logo to use:

ActiveDocument.Sections(1).Headers(wdHeaderFooterFirstPage).Shapes("logo").Visible
= True
ActiveDocument.Sections(1).Headers(wdHeaderFooterFirstPage).Shapes("colorlogo").Visible
= True

Obviously, we can't just delete the graphic and insert the new one, and we
can't figure out where the names "logo" or "colorlogo" are assigned/stored.
We converted recently to Office 2003 so the code was probably written in
Word 2000. How do we assign a label of "logo" to a new graphic? If this
isn't possible, how can we assign a new label and update the VBA code to use
this label.

Is there a better way to structure these lines so they correctly ID the
graphics?

Any help would be appreciated. Thanks!
 
B

Brian Gilbert

I didn't get a response and thought adding the code might be helpful....
Hi.

We have existing VBA code (created by someone else) that lets users switch
between two graphics in a Word doc. We now need to replace one of the
graphics but are having problems. The code uses a couple of lines in
several If statements to determine which logo to use:
If Me.chkLetterhead.Value = False And Me.optBlack.Value = True Then
ActiveDocument.Sections(1).Headers(wdHeaderFooterFirstPage).Shapes("logo").Visible
= True
ActiveDocument.Sections(1).Headers(wdHeaderFooterFirstPage).Shapes("colorlogo").Visible
= False
ElseIf Me.chkLetterhead.Value = False And Me.optBlack.Value = False Then
ActiveDocument.Sections(1).Headers(wdHeaderFooterFirstPage).Shapes("logo").Visible
= False
ActiveDocument.Sections(1).Headers(wdHeaderFooterFirstPage).Shapes("colorlogo").Visible
= True
End If
Obviously, we can't just delete the graphic and insert the new one, and we
can't figure out where the names "logo" or "colorlogo" are
assigned/stored. We converted recently to Office 2003 so the code was
probably written in Word 2000. How do we assign a label of "logo" to a new
graphic? If this isn't possible, how can we assign a new label and update
the VBA code to use this label.

Is there a better way to structure these lines so they correctly ID the
graphics?

Any help would be appreciated. Thanks!
Brian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top