Bold, underlined, and other format button status

  • Thread starter Thread starter Dennis Brown
  • Start date Start date
D

Dennis Brown

Hi All,
I need to determine if the Bold, Underline, Italics, etc. formatting buttons are pressed within the format toolbar within an HTML message editing session. What is the syntax to that button's status?
 
Hi Dennis,

if not done already then add a reference to the "Microsoft Office x.0
Library" to your project. Now you can find the Office.CommandBars and
CommandBarButton via the Object Browser.

For each button in question you can get a reference with the
CommandBars.FindControl function and the returned CommandBarButton
object has a State property. You just need to proper FaceID for each
button.

Sample for the bold button:

dim oBtn as Office.CommandBarButton
Set oBtn=Application.ActiveInspector.CommandBars.FindControl(,113)
If oBtn.State=msoButtonDown Then
' It´s pressed
Endif

The IDs are for:

Underline = 115
Italic = 114

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook


Hi All,
I need to determine if the Bold, Underline, Italics, etc. formatting
buttons are pressed within the format toolbar within an HTML message
editing session. What is the syntax to that button's status?
 
Thanks a bunch! This looks like it will do the trick.

--

Thanks,
Dennis
Hi Dennis,

if not done already then add a reference to the "Microsoft Office x.0
Library" to your project. Now you can find the Office.CommandBars and
CommandBarButton via the Object Browser.

For each button in question you can get a reference with the
CommandBars.FindControl function and the returned CommandBarButton
object has a State property. You just need to proper FaceID for each
button.

Sample for the bold button:

dim oBtn as Office.CommandBarButton
Set oBtn=Application.ActiveInspector.CommandBars.FindControl(,113)
If oBtn.State=msoButtonDown Then
' It´s pressed
Endif

The IDs are for:

Underline = 115
Italic = 114

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook


Hi All,
I need to determine if the Bold, Underline, Italics, etc. formatting
buttons are pressed within the format toolbar within an HTML message
editing session. What is the syntax to that button's status?
 
Thanks again! This works like a charm!

--

Thanks,
Dennis
Hi Dennis,

if not done already then add a reference to the "Microsoft Office x.0
Library" to your project. Now you can find the Office.CommandBars and
CommandBarButton via the Object Browser.

For each button in question you can get a reference with the
CommandBars.FindControl function and the returned CommandBarButton
object has a State property. You just need to proper FaceID for each
button.

Sample for the bold button:

dim oBtn as Office.CommandBarButton
Set oBtn=Application.ActiveInspector.CommandBars.FindControl(,113)
If oBtn.State=msoButtonDown Then
' It´s pressed
Endif

The IDs are for:

Underline = 115
Italic = 114

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook


Hi All,
I need to determine if the Bold, Underline, Italics, etc. formatting
buttons are pressed within the format toolbar within an HTML message
editing session. What is the syntax to that button's status?
 
Back
Top