Rafael1119
Sue/All,
My form region is a seperate page extension to my appointment form. What I want to do is create a meeting invite and enter additional info that only people with the form region can view.
I've done the following:
1. Created Add-In project and added my Form Region to it
2. Install on my workstation
3. Had two users install on their workstations (installed fine)
4. User1 sent me a meeting invite but no data was retained on the form region when I open the meeting invite (is this intended )
Here is the FormRegionHookup code I'm using from a walkthrough I found in msdn (I think):
Imports System.Runtime.InteropServices
Imports Outlook = Microsoft.Office.Interop.Outlook
Imports Microsoft.Vbe.Interop.Forms
Imports System.Windows.Forms
<ComVisible(True), _
Guid("88F7BFBE-7666-4a0c-BCFD-2740E6625E04"), _
ProgId("FormRegionAddIn.FormRegionHookup"), _
ClassInterface(ClassInterfaceType.AutoDual)> _
Public Class FormRegionHookup
Implements Outlook.FormRegionStartup
Private FormRegion As Outlook.FormRegion
Private userForm As UserForm
Private OlkTextBox2 As Outlook.OlkTextBox
Private WithEvents CommandButton1 As Outlook.OlkCommandButton
' Returns FormRegion.ofs from the resource collection of the current Addin project.
Public Function GetFormRegionStorage( _
ByVal FormRegionName As String, _
ByVal Item As Object, _
ByVal LCID As Integer, _
ByVal FormRegionMode As Outlook.OlFormRegionMode, _
ByVal FormRegionSize As Outlook.OlFormRegionSize) As Object _
Implements Outlook.FormRegionStartup.GetFormRegionStorage
Application.DoEvents()
Select Case FormRegionName
Case "MeetingDetails"
Dim ofsBytes As Byte()
ofsBytes = My.Resources.MeetingDetails
Return ofsBytes
Case Else
Return Nothing
End Select
End Function
' Maps the fields you defined in the FormRegionHookup class to controls on the form region
Public Sub BeforeFormRegionShow( _
ByVal FormRegion As Outlook.FormRegion) _
Implements Outlook.FormRegionStartup.BeforeFormRegionShow
Me.FormRegion = FormRegion
Me.userForm = FormRegion.Form
Try
'OlkTextBox2 = userForm.Controls.Item("OlkTextBox2")
'CommandButton1 = userForm.Controls.Item("CommandButton1")
Catch ex As Exception
MessageBox.Show(ex.ToString())
End Try
End Sub
Public Function GetFormRegionManifest( _
ByVal formRegionName As String, _
ByVal LCID As Integer) As Object _
Implements Outlook.FormRegionStartup.GetFormRegionManifest
Throw New Exception("The method or operation is not implemented.")
End Function
Public Function GetFormRegionIcon( _
ByVal formRegionName As String, _
ByVal LCID As Integer, _
ByVal icon As Outlook.OlFormRegionIcon) As Object _
Implements Outlook.FormRegionStartup.GetFormRegionIcon
Throw New Exception("The method or operation is not implemented.")
End Function
' Handles a click on the button of our form region
Private Sub CommandButton1_Click() Handles CommandButton1.Click
'MessageBox.Show(OlkTextBox2.Text)
Dim myOLApp As New Outlook.Application
Dim myExpl As Outlook.Explorer = myOLApp.ActiveExplorer
Dim x As Integer
Dim Item As Outlook.AppointmentItem
For x = 0 To myExpl.Selection.Count
Item = myExpl.Selection.Item(x)
MessageBox.Show("Meeting Duration: " & Item.Duration)
Next
myOLApp = Nothing
myExpl = Nothing
x = Nothing
Item = Nothing
End Sub
End Class
Any thoughts
Thanks,
Rafael