S
sdfhgsdhf
Hi all, I'd be most grateful if you could help on this one. I am trying to
programmatically access Control objects within a custom form from an Outlook
2000 VBA application. However, the help files for VBA list the 'Pages'
collection object but not the 'Page' object-- which leads me to believe I
have to use VBS for this. However, using VBS is of no use here as the
results of the call need to go back to the VBA application.
The routine I am working on at the moment is below. It attempts to get the
Pages collection using ModifiedFormPages, then attempts to get a page by
supplying a page name as an index to this collection. This should be simple,
but I suspect some functionality has been removed from Outlook VBA to stop
me doing this.
Thanks in advance!
----------------------------
Public Sub readFormItem(ByVal itemID As Integer)
' Reads data about an item on the folder form
Dim myFolder As Outlook.MAPIFolder
Dim myItem As Outlook.ContactItem
Dim myMod As Outlook.Pages
Dim myPage As Page
Dim a As Integer
Set myFolder = getAdvisersFolder
Set myItem = myFolder.Items.GetFirst
MsgBox myItem.FullName ' <-- this reports OK
Set myMod = myItem.GetInspector.ModifiedFormPages ' <-- this executes
OK
MsgBox "Got modified form pages"
Set myPage = myMod("Member advisers") ' <-- *** fails here ****
MsgBox "Got page"
For a = 0 To myForm.Controls.count
MsgBox myForm.Caption
Next
End Sub
programmatically access Control objects within a custom form from an Outlook
2000 VBA application. However, the help files for VBA list the 'Pages'
collection object but not the 'Page' object-- which leads me to believe I
have to use VBS for this. However, using VBS is of no use here as the
results of the call need to go back to the VBA application.
The routine I am working on at the moment is below. It attempts to get the
Pages collection using ModifiedFormPages, then attempts to get a page by
supplying a page name as an index to this collection. This should be simple,
but I suspect some functionality has been removed from Outlook VBA to stop
me doing this.
Thanks in advance!
----------------------------
Public Sub readFormItem(ByVal itemID As Integer)
' Reads data about an item on the folder form
Dim myFolder As Outlook.MAPIFolder
Dim myItem As Outlook.ContactItem
Dim myMod As Outlook.Pages
Dim myPage As Page
Dim a As Integer
Set myFolder = getAdvisersFolder
Set myItem = myFolder.Items.GetFirst
MsgBox myItem.FullName ' <-- this reports OK
Set myMod = myItem.GetInspector.ModifiedFormPages ' <-- this executes
OK
MsgBox "Got modified form pages"
Set myPage = myMod("Member advisers") ' <-- *** fails here ****
MsgBox "Got page"
For a = 0 To myForm.Controls.count
MsgBox myForm.Caption
Next
End Sub