Bold, underlined, and other format button status

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?
 
M

Michael Bauer

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?
 
D

Dennis Brown

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?
 
D

Dennis Brown

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?
 

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