I am using VS2008 and am using the Outlook 2007 Add-In
I need to pull some form data from outlook into a ribbon.
I am trying to duplicate the Call button/menu in Contacts item. The Call
button drops down and lists all the Phone Numbers available.
I need to do the same thing. However, I am handing the number when
selected
to another application.
I have created the Ribbon using the following:
***RibbonCall.XML***
<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
onLoad="Ribbon_Load">
<ribbon>
<tabs>
<tab idMso="TabContact">
<group id="groupCtrlItCallManager" label="Ctrl IT Call Manager">
<dynamicMenu id="dynMenuContactPhoneNumbers" imageMso="AutoDial"
label="Call
Contact" getContent="GetContent" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>
***RibbonCall.vb
***Here is the Code***
#Region "Ribbon Callbacks"
'Create callback methods here. For more information about adding callback
methods, select the Ribbon XML item in Solution Explorer and then press
F1.
Public Sub Ribbon_Load(ByVal ribbonUI As Office.IRibbonUI)
Me.ribbon = ribbonUI
End Sub
Public Function GetContent(ByVal control As
Microsoft.Office.Core.IRibbonControl) As String
Dim MyStringBuilder As StringBuilder = New StringBuilder("<menu
xmlns=""http://schemas.microsoft.com/office/2006/01/customui""
>")
' Phone Numbers available for calling
' HELP ME HERE ---> I am trying top populate phoneNumber, but not sure how
to access the form data from here.
MyStringBuilder.Append("<button id=""btnContactPrimary"" label=""Primary:
"
& phoneNumber & " onAction=""OnAction"" imageMso=""AutoDial"" />")
' HELP ME HERE ---> I am trying top populate phoneNumber, but not sure how
to access the form data from here.
MyStringBuilder.Append("<button id=""btnContactMobile"" label=""Mobile: "
&
phoneNumber & " onAction=""OnAction"" imageMso=""AutoDial"" />")
' Seperator
MyStringBuilder.Append("<menuSeparator id=""menuSeperator1""
getTitle=""GetTitle"" />")
' Other Numbers, Redial, Speed Dial - Enables you to never leave screen to
make call.
MyStringBuilder.Append("<button id=""btnRedial"" label=""Redial""
onAction=""OnAction"" />")
MyStringBuilder.Append("<button id=""btnSpeedDial"" label=""Speed Dial""
onAction=""OnAction"" />")
' Seperator
MyStringBuilder.Append("<menuSeparator id=""menuSeperator2""
getTitle=""GetTitle"" />")
' New Call
MyStringBuilder.Append("<button id=""btnNewCall"" label=""New Call""
onAction=""OnAction"" imageMso=""AutoDial"" />")
MyStringBuilder.Append("</menu>")
Return MyStringBuilder.ToString
End Function
End Function
#End Region