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