A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Adding a button to the Appointment Form



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old March 14th 06, 08:55 AM posted to microsoft.public.outlook.program_addins
[email protected]
external usenet poster
 
Posts: 17
Default Adding a button to the Appointment Form

Hi Ppl,

I really really need help this time......
Could you please tell me what is wrong with the code below:

Private Sub oInspector_NewInspector(ByVal Inspector As
Microsoft.Office.Interop.Outlook.Inspector) Handles
oInspector.NewInspector
Try
oAppointment = CType(Inspector.CurrentItem,
AppointmentItem)
'SetCommandBars(oAppointment)
Dim oCommandBars As CommandBars
'Outlook has the CommandBars collection on the Explorer
object.
oCommandBars = oAppointment.GetInspector.CommandBars
'In case the button was not deleted, use the exiting one.
'Try
'Toolbox = CType(oCommandBars("Standard").Controls("Int"),
CommandBarButton)
'Catch
'If btnToolbox Is Nothing Then
btnToolbox = CType(oCommandBars("Standard").Controls.Add(1,
System.Reflection.Missing.Value, System.Reflection.Missing.Value,
System.Reflection.Missing.Value, System.Reflection.Missing.Value),
CommandBarButton)
With btnToolbox
.Caption = "Toolbox Details"
.Style = MsoButtonStyle.msoButtonCaption
.Tag = "Toolbox Details"
.OnAction = "!IntOutlook.Connect"
.Visible = True
End With
'End If
'End Try

Catch
'not an Appointment
End Try
End Sub

All I want to do is add a button in the Standard toolbar of the
Appointment form....

Desperate for help.....
Thanx

  #2  
Old March 14th 06, 04:48 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Adding a button to the Appointment Form

And what happens? Any errors?

Normally you would want to make sure that the item is an appointment before
doing the rest of the code. That can be done by checking the Class of
Inspector.CurrentItem.

I also usually defer creating my buttons in an Inspector until the first
Activate event fires for that Inspector.

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


wrote in message
oups.com...
Hi Ppl,

I really really need help this time......
Could you please tell me what is wrong with the code below:

Private Sub oInspector_NewInspector(ByVal Inspector As
Microsoft.Office.Interop.Outlook.Inspector) Handles
oInspector.NewInspector
Try
oAppointment = CType(Inspector.CurrentItem,
AppointmentItem)
'SetCommandBars(oAppointment)
Dim oCommandBars As CommandBars
'Outlook has the CommandBars collection on the Explorer
object.
oCommandBars = oAppointment.GetInspector.CommandBars
'In case the button was not deleted, use the exiting one.
'Try
'Toolbox = CType(oCommandBars("Standard").Controls("Int"),
CommandBarButton)
'Catch
'If btnToolbox Is Nothing Then
btnToolbox = CType(oCommandBars("Standard").Controls.Add(1,
System.Reflection.Missing.Value, System.Reflection.Missing.Value,
System.Reflection.Missing.Value, System.Reflection.Missing.Value),
CommandBarButton)
With btnToolbox
.Caption = "Toolbox Details"
.Style = MsoButtonStyle.msoButtonCaption
.Tag = "Toolbox Details"
.OnAction = "!IntOutlook.Connect"
.Visible = True
End With
'End If
'End Try

Catch
'not an Appointment
End Try
End Sub

All I want to do is add a button in the Standard toolbar of the
Appointment form....

Desperate for help.....
Thanx


  #3  
Old March 15th 06, 01:21 AM posted to microsoft.public.outlook.program_addins
[email protected]
external usenet poster
 
Posts: 17
Default Adding a button to the Appointment Form

Thanks Ken....
U r a star with (an) Outlook

  #4  
Old March 15th 06, 01:21 AM posted to microsoft.public.outlook.program_addins
[email protected]
external usenet poster
 
Posts: 17
Default Adding a button to the Appointment Form

Thanks Ken....
U r a star with (an) Outlook

  #5  
Old March 21st 06, 01:36 AM posted to microsoft.public.outlook.program_addins
[email protected]
external usenet poster
 
Posts: 17
Default Adding a button to the Appointment Form

I am trying to delete the button in the Inspector Close event but it
doesnot seem to be working.
oCommandBars("Standard").Controls("Opportunities") .Delete(System.Reflection.Missing.Value)

The button has been designed to only load for the Appointment Items.
I'm sure it is not being deleted because when I create a new mail
message it is not visible but once I create an appointment and reopen
the mail message the button is available in the standard toolbar.

Suggestions?

Thanx

  #6  
Old March 21st 06, 03:09 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Adding a button to the Appointment Form

Delete really shouldn't be needed if you create the button as Temporary :=
True.

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


wrote in message
ups.com...
I am trying to delete the button in the Inspector Close event but it
doesnot seem to be working.
oCommandBars("Standard").Controls("Opportunities") .Delete(System.Reflection.Missing.Value)

The button has been designed to only load for the Appointment Items.
I'm sure it is not being deleted because when I create a new mail
message it is not visible but once I create an appointment and reopen
the mail message the button is available in the standard toolbar.

Suggestions?

Thanx


  #7  
Old March 14th 06, 04:54 PM posted to microsoft.public.outlook.program_addins
Rog
external usenet poster
 
Posts: 62
Default Adding a button to the Appointment Form

I use C# for my addins and looking at this line:
CType(oCommandBars("Standard").Controls.Add(1,
System.Reflection.Missing.Value, System.Reflection.Missing.Value,
System.Reflection.Missing.Value, System.Reflection.Missing.Value),
CommandBarButton)
usually the last parameter is true or false for temporary or not.
Rog

wrote:
Hi Ppl,

I really really need help this time......
Could you please tell me what is wrong with the code below:

Private Sub oInspector_NewInspector(ByVal Inspector As
Microsoft.Office.Interop.Outlook.Inspector) Handles
oInspector.NewInspector
Try
oAppointment = CType(Inspector.CurrentItem,
AppointmentItem)
'SetCommandBars(oAppointment)
Dim oCommandBars As CommandBars
'Outlook has the CommandBars collection on the Explorer
object.
oCommandBars = oAppointment.GetInspector.CommandBars
'In case the button was not deleted, use the exiting one.
'Try
'Toolbox = CType(oCommandBars("Standard").Controls("Int"),
CommandBarButton)
'Catch
'If btnToolbox Is Nothing Then
btnToolbox = CType(oCommandBars("Standard").Controls.Add(1,
System.Reflection.Missing.Value, System.Reflection.Missing.Value,
System.Reflection.Missing.Value, System.Reflection.Missing.Value),
CommandBarButton)
With btnToolbox
.Caption = "Toolbox Details"
.Style = MsoButtonStyle.msoButtonCaption
.Tag = "Toolbox Details"
.OnAction = "!IntOutlook.Connect"
.Visible = True
End With
'End If
'End Try

Catch
'not an Appointment
End Try
End Sub

All I want to do is add a button in the Standard toolbar of the
Appointment form....

Desperate for help.....
Thanx

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding additional text to an appointment in addition to the subjec Aly Outlook - Calandaring 3 March 10th 06 02:22 PM
Mistake made adding NEWS to GO button Computer Queen Outlook - Installation 1 March 8th 06 10:57 AM
Adding a 2nd button (functionality not working) Newt Outlook and VBA 3 March 6th 06 06:35 PM
adding a "print this slide" action button to powerpoint presentat ixratee Outlook - Using Forms 0 February 6th 06 11:14 PM
Need code for appointment form Colin Coady Outlook - Using Forms 0 January 18th 06 02:21 PM


All times are GMT +1. The time now is 12:39 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.