Having a Macro Icon Toggle

J

Jim

On Word the Bold, Italics and Underline are all gray when not toggled
but black when they are as you well know. I would like to make an
icon that would indicate when print hidden text is toggled and when it
isn't. Is there any way to to that?

Also, I would like to have an icon that I can look at to know what
printer is currently set. I have several and it would be useful for me
to be able just to look at the screen to know which one I have it set
to. I would like to have one icon indicate green for one printer, and
blue for another and so on.

Thanks for any help you can give on this subject.
 
H

Helmut Weber

Hi Jim
Thanks for any help you can give on this subject.

if so, then have a look at this one,
which requires quite a lot of preparation.
I've set up a custom toolbar with two custom icons.
One for "print hidden text",
one for "don't print hidden text".
And added a control to the formatting toolbar.
In my case it is control 27.

When executing the following macro,
the face of control 27 changes according to the print options.

Sub ShowOptions()
If Application.Options.PrintHiddenText = True Then
Application.CommandBars("Custom1").Controls(1).CopyFace
Application.CommandBars("Formatting").Controls(27).PasteFace
Else
Application.CommandBars("Custom1").Controls(2).CopyFace
Application.CommandBars("Formatting").Controls(27).PasteFace
End If
End Sub

Unfortunately, there is no options-change-event.

So I see no way, except an extra mouse-click,
to update the faces of the controls.

Same for printers.

It ain't that easy.

HTH

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 
H

Helmut Weber

Hmm...

why not have a button to toggle .PrintHiddenText
and show whether it is true or false?

Sub TogglePrintHidden()
With Application
.Options.PrintHiddenText = Not .Options.PrintHiddenText
If .Options.PrintHiddenText = True Then
.CommandBars("Custom1").Controls(1).CopyFace
.CommandBars("Formatting").Controls(27).PasteFace
Else
.CommandBars("Custom1").Controls(2).CopyFace
.CommandBars("Formatting").Controls(27).PasteFace
End If
End With
End Sub

Which overwrites the clipboard. :-(

Or use a builtin faceId.

But a face for .PrintHiddenText = true
or .PrintHiddenText = false
might be hard to find.

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 

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