Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2007

Tip: Looking for answers? Try searching our database.

Having a Macro Icon Toggle

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jim - 30 Mar 2007 19:43 GMT
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.
Helmut Weber - 30 Mar 2007 23:28 GMT
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

Signature

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

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

Helmut Weber - 31 Mar 2007 09:33 GMT
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.

Signature

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

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


Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.