![]() |
| 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. |
|
|||||||
| Tags: toolbar |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
I have code attached to a button on a new toolbar. I added the toolbar to
the new appointment form which is correct. But now I see the toolbar on the new email, new task etc. forms. It is only appropriate on the new appointment form. Any suggestions? -- Teach me to fish! Thanks for the help. Pax, M |
| Ads |
|
#2
|
|||
|
|||
|
I figured it out. I just removed it from all forms and reset it on the
appointment form. -- Teach me to fish! Thanks for the help. Pax, M "m stroup" wrote: I have code attached to a button on a new toolbar. I added the toolbar to the new appointment form which is correct. But now I see the toolbar on the new email, new task etc. forms. It is only appropriate on the new appointment form. Any suggestions? -- Teach me to fish! Thanks for the help. Pax, M |
|
#3
|
|||
|
|||
|
So, that really didn't fix it.
I created a toolbar called "myOLAddOns". I want it to only be enabled/visible/present on the new appointment form. I am new to outlook programming (as you will see) but this is what I have so far and it is not working. Any suggestions would be greatly appreciated. I have added this code to "this outlook session", thinking it would be triggered anytime I opened a "new" form. Dim objApp As Application Dim objIns As Outlook.Inspector Dim objItem As Object Dim objCB As Office.commandbars Dim objCBB As CommandBarControl Set objApp = CreateObject("Outlook.Application") Set objIns = objApp.ActiveInspector Set objItem = objApp.ActiveInspector.CurrentItem Set objCB = objIns.commandbars Set objCBB = objCB.item("myOlAddOns").Controls.item("Post to Personal and Team Lead Calendars") If objIns.Class = olAppointment Then objCBB.Enabled = True Else objCBB.Enabled = False End If -- Teach me to fish! Thanks for the help. Pax, M "m stroup" wrote: I figured it out. I just removed it from all forms and reset it on the appointment form. -- Teach me to fish! Thanks for the help. Pax, M "m stroup" wrote: I have code attached to a button on a new toolbar. I added the toolbar to the new appointment form which is correct. But now I see the toolbar on the new email, new task etc. forms. It is only appropriate on the new appointment form. Any suggestions? -- Teach me to fish! Thanks for the help. Pax, M |
|
#4
|
|||
|
|||
|
You need to monitor the NewInspector event for a Inspectors collection
declared using WithEvents at the module level. You would get the Inspectors collection from the Application.Inspectors object during Application_Startup in ThisOutlookSession. Then simply don't process any Inspectors in the NewInspector event if it doesn't meet your criteria. It's also best to implement an Inspector wrapper, so that your custom toolbars/buttons will work if multiple items are opened (and you won't be subject to the "last inspector wins" scenario). For some great sample code that shows best practices with Inspectors and custom toolbars, see the COM Add-In projects he http://www.slovaktech.com/code_samples.htm -- Eric Legault [MVP - Outlook] MCDBA, MCTS (Messaging & Collaboration, SharePoint Infrastructure, MOSS 2007 & WSS 3.0 Application Development) Collaborative Innovations - Try Picture Attachments Wizard For Microsoft Outlook - Web: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault "m stroup" wrote in message ... So, that really didn't fix it. I created a toolbar called "myOLAddOns". I want it to only be enabled/visible/present on the new appointment form. I am new to outlook programming (as you will see) but this is what I have so far and it is not working. Any suggestions would be greatly appreciated. I have added this code to "this outlook session", thinking it would be triggered anytime I opened a "new" form. Dim objApp As Application Dim objIns As Outlook.Inspector Dim objItem As Object Dim objCB As Office.commandbars Dim objCBB As CommandBarControl Set objApp = CreateObject("Outlook.Application") Set objIns = objApp.ActiveInspector Set objItem = objApp.ActiveInspector.CurrentItem Set objCB = objIns.commandbars Set objCBB = objCB.item("myOlAddOns").Controls.item("Post to Personal and Team Lead Calendars") If objIns.Class = olAppointment Then objCBB.Enabled = True Else objCBB.Enabled = False End If -- Teach me to fish! Thanks for the help. Pax, M "m stroup" wrote: I figured it out. I just removed it from all forms and reset it on the appointment form. -- Teach me to fish! Thanks for the help. Pax, M "m stroup" wrote: I have code attached to a button on a new toolbar. I added the toolbar to the new appointment form which is correct. But now I see the toolbar on the new email, new task etc. forms. It is only appropriate on the new appointment form. Any suggestions? -- Teach me to fish! Thanks for the help. Pax, M |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| No Toolbar | James | Outlook Express | 7 | February 26th 07 09:02 PM |
| TOOLBAR PROBLEM | its_my_dime | Outlook - General Queries | 0 | December 26th 06 10:09 PM |
| Toolbar | Nick G | Outlook Express | 2 | December 19th 06 04:15 AM |
| Toolbar problem | Lesley | Outlook Express | 7 | August 30th 06 11:19 AM |
| IE Toolbar | Nee | Outlook Express | 2 | April 1st 06 04:10 PM |