Word 2002 - Unhide Grahpic in Header

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to write a macro which will open a header, file the hidden graphic,
and make the graphic visible.

Does anyone know how to do this? I can open the Header and Footer, but when
I do a find for the graphic, it does not find anything.

Brenda Levien.
 
Hi =?Utf-8?B?Qi4gTGV2aWVu?=,
I need to write a macro which will open a header, file the hidden graphic,
and make the graphic visible.

Does anyone know how to do this? I can open the Header and Footer, but when
I do a find for the graphic, it does not find anything.
You can address a graphic in a specified range directly, without having to Find
it. Since you can hide it, I'm assuming it's not been formatted with any text
wrap. This would make it an InlineShape (as opposed to a Shape). So something
along these lines:

Dim doc as Word.document
Dim rng as Word.Range
Dim ils as Word.InlineShape

Set doc = ActiveDocument
Set rng = doc.Sections(1).Headers(wdHeaderFooterPrimary).Range
rng.InlineShapes(1).Range.Font.Hidden = false

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)
 
Are you writing Visual Basic?

Most macros we create are through Tools and Macros, not Visual.

I found that if I pause record, and choose the macro, and then start
recording, the macro runs as I intended.

Thanks.
 
Hi =?Utf-8?B?Qi4gTGV2aWVu?=,
Are you writing Visual Basic?

Most macros we create are through Tools and Macros, not Visual.
ALL macros you record are written down as Visual Basic for Applications
(VBA). Choose one of your macros in Tools/Macro/Macros, then click
"Edit" and you'll see what I mean :-)

If you want a macro to do something that the macro recorder can't
handle, then you must edit it or, sometimes, write the macro from
scratch.
I found that if I pause record, and choose the macro, and then start
recording, the macro runs as I intended.
If this works for you, that's fine :-)

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :-)
 

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

Back
Top