![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
Hi All,
I'm attempting to add a button (or any other control!) to the inspector when displaying messages. The sample below can be executed, and it will add a toolbar and button in 3 out of 4 cases. Works for message composition, both with word-as-editor enabled and disabled. Works for message display, not using word for RTF. Fails when using word to display RTF messages. (Outlook | Tools | Options | MailFormat | Use Microsoft Office 2003 to read Rich Text e-mail messages) A discussion in another forum alluded to Word being used in a mode whereby its command bars are read only. Is there any basis to this? I also noticed that Outlook Spy (2.10.0.352) doesn't load its command bar when word is used to display an RTF message. I have also tried navigating to the wordDoc CommandBars, and tried (a) adding a new CommandBar, and (b) adding a new button to an existing CommandBar, but eventually get the same result in both cases on attempting to add the new control. Using Outlook 2003 SP1. Does anyone have any ideas? Or is it time to give up, and look for some other way to display message status info to the user? ' Sample code to work out why can't add button to Outlook Word RTF viewer ' Doesn't work when Outlook set up to use Word to view RTF messages ' Throws error: "Method 'Add' of _CommandBars failed" ErrorID 0x80004005 ' Works in other cases ' a) compose using word editor ' b) compose using rtf(?) editor ' c) display using rtf(?) viewer Option Explicit Dim WithEvents objInspectors As Outlook.Inspectors Dim WithEvents objInspector As Outlook.Inspector Dim objCommandBar As office.CommandBar Dim objCommandBarCtrl As office.CommandBarButton Private Sub Application_Quit() Set objInspectors = Nothing End Sub Private Sub Application_Startup() Set objInspectors = Application.Inspectors End Sub Private Sub objInspector_Close() Set objCommandBarCtrl = Nothing Set objCommandBar = Nothing Set objInspector = Nothing End Sub Private Sub objInspectors_NewInspector(ByVal Inspector As Inspector) Set objInspector = Inspector ' fails on the following line Set objCommandBar = objInspector.CommandBars.Add("Hello", office.msoBarTop, True, True) objCommandBar.Enabled = True objCommandBar.Visible = True Set objCommandBarCtrl = objCommandBar.Controls.Add(office.msoControlButton ) objCommandBarCtrl.Style = msoButtonCaption objCommandBarCtrl.Visible = True objCommandBarCtrl.Enabled = True objCommandBarCtrl.Caption = "World!" End Sub |
#2
|
|||
|
|||
![]()
OK, no responses.
Try some other questions. When word is used to display RTF messages, is the toolbar customizable? Try this: 1. Send an RTF message using Outlook 2003. 2. Have a look in sent items, and display the message. Check that the title bar shows that the messaeg is Rich Text. 3. Try manually customizing the toolbar. View | Toolbar. Note that "Customize..." is disabled. Does this mean also that the toolbar can't be progarmmatically customized? (Weird thing is that you can modify the message body - which normally is readonly!) Is this the same for anyone else, or is it just me setup? (Please reply to maillist.) james wrote: Hi All, I'm attempting to add a button (or any other control!) to the inspector when displaying messages. The sample below can be executed, and it will add a toolbar and button in 3 out of 4 cases. Works for message composition, both with word-as-editor enabled and disabled. Works for message display, not using word for RTF. Fails when using word to display RTF messages. (Outlook | Tools | Options | MailFormat | Use Microsoft Office 2003 to read Rich Text e-mail messages) A discussion in another forum alluded to Word being used in a mode whereby its command bars are read only. Is there any basis to this? I also noticed that Outlook Spy (2.10.0.352) doesn't load its command bar when word is used to display an RTF message. I have also tried navigating to the wordDoc CommandBars, and tried (a) adding a new CommandBar, and (b) adding a new button to an existing CommandBar, but eventually get the same result in both cases on attempting to add the new control. Using Outlook 2003 SP1. Does anyone have any ideas? Or is it time to give up, and look for some other way to display message status info to the user? ' Sample code to work out why can't add button to Outlook Word RTF viewer ' Doesn't work when Outlook set up to use Word to view RTF messages ' Throws error: "Method 'Add' of _CommandBars failed" ErrorID 0x80004005 ' Works in other cases ' a) compose using word editor ' b) compose using rtf(?) editor ' c) display using rtf(?) viewer Option Explicit Dim WithEvents objInspectors As Outlook.Inspectors Dim WithEvents objInspector As Outlook.Inspector Dim objCommandBar As office.CommandBar Dim objCommandBarCtrl As office.CommandBarButton Private Sub Application_Quit() Set objInspectors = Nothing End Sub Private Sub Application_Startup() Set objInspectors = Application.Inspectors End Sub Private Sub objInspector_Close() Set objCommandBarCtrl = Nothing Set objCommandBar = Nothing Set objInspector = Nothing End Sub Private Sub objInspectors_NewInspector(ByVal Inspector As Inspector) Set objInspector = Inspector ' fails on the following line Set objCommandBar = objInspector.CommandBars.Add("Hello", office.msoBarTop, True, True) objCommandBar.Enabled = True objCommandBar.Visible = True Set objCommandBarCtrl = objCommandBar.Controls.Add(office.msoControlButton ) objCommandBarCtrl.Style = msoButtonCaption objCommandBarCtrl.Visible = True objCommandBarCtrl.Enabled = True objCommandBarCtrl.Caption = "World!" End Sub |
#3
|
|||
|
|||
![]()
Customize is grayed out for any WordMail item (in the UI). Check it out with
a new HTML email. When you're in WordMail you can access Inspector.CommandBars but what you get is the Word CommandBars collection. You can add items to "Menu Bar" and create your own toolbar (CommandBar). Adding to Standard or whatever isn't going to work and forget about adding buttons to the mail envelope toolbars. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "james" wrote in message oups.com... OK, no responses. Try some other questions. When word is used to display RTF messages, is the toolbar customizable? Try this: 1. Send an RTF message using Outlook 2003. 2. Have a look in sent items, and display the message. Check that the title bar shows that the messaeg is Rich Text. 3. Try manually customizing the toolbar. View | Toolbar. Note that "Customize..." is disabled. Does this mean also that the toolbar can't be progarmmatically customized? (Weird thing is that you can modify the message body - which normally is readonly!) Is this the same for anyone else, or is it just me setup? (Please reply to maillist.) |
#4
|
|||
|
|||
![]()
Hi Ken,
You can add items to "Menu Bar" and create your own toolbar (CommandBar). I tried this and failed adding a CommandBar when _reading_ an RTF message with word (see sample code from original post). It does works if I'm composing a message. My Outlook Spy doesn't load its command bar in this mode either. Just trying to work out if something in my setup is causing this probelm, or if its a general Outlook/WordMail limitation. thanks Ken Slovak - [MVP - Outlook] wrote: Customize is grayed out for any WordMail item (in the UI). Check it out with a new HTML email. When you're in WordMail you can access Inspector.CommandBars but what you get is the Word CommandBars collection. You can add items to "Menu Bar" and create your own toolbar (CommandBar). Adding to Standard or whatever isn't going to work and forget about adding buttons to the mail envelope toolbars. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "james" wrote in message oups.com... OK, no responses. Try some other questions. When word is used to display RTF messages, is the toolbar customizable? Try this: 1. Send an RTF message using Outlook 2003. 2. Have a look in sent items, and display the message. Check that the title bar shows that the messaeg is Rich Text. 3. Try manually customizing the toolbar. View | Toolbar. Note that "Customize..." is disabled. Does this mean also that the toolbar can't be progarmmatically customized? (Weird thing is that you can modify the message body - which normally is readonly!) Is this the same for anyone else, or is it just me setup? (Please reply to maillist.) |
#5
|
|||
|
|||
![]()
It's a limitation.
-- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "james" wrote in message ups.com... Hi Ken, You can add items to "Menu Bar" and create your own toolbar (CommandBar). I tried this and failed adding a CommandBar when _reading_ an RTF message with word (see sample code from original post). It does works if I'm composing a message. My Outlook Spy doesn't load its command bar in this mode either. Just trying to work out if something in my setup is causing this probelm, or if its a general Outlook/WordMail limitation. thanks |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Outlook 2003 RTF Messages | Michael | Outlook - General Queries | 0 | April 14th 06 12:49 PM |
Adding button to New Message Window | Joshua Ellul | Add-ins for Outlook | 5 | March 22nd 06 02:10 PM |
Adding a button to the Appointment Form | [email protected] | Add-ins for Outlook | 6 | March 21st 06 03:09 PM |
Send - Receive Button Still Fails to appear | John | Outlook - Installation | 0 | January 18th 06 09:42 AM |
Send - Receive Button fails to appear in Outlook 2003 | John | Outlook - Installation | 2 | January 15th 06 03:45 AM |