B
bigbrorpi
I'm trying to get Sue Mosher's Vacation form working, and had posted in
the past and was unable to complete the project.
I have changed the folder names to reflect mine, and have published the
form to the Org. Forms Lib. w/o the "save definitions" box checked. I'm
running under Outlook 2002.
In my main code as shown below, I get a permission denied error when I
try to set the Folder property of objCtrl. I've checked, and
GetCalFolder returns correctly in a msgbox. I'm sure I'm missing
something simple here, but I just can't get past this. Any help would
be appreciated!!
Thanks!
Function Item_Open()
Dim objPage
Dim objCtrl
Dim objRecip
Dim strManager
Dim strFolderPath
InitOpts
Set objPage = Item.GetInspector.ModifiedFormPages("Vacations")
Set objCtrl = objPage.Controls("OVCtl1")
If Item.Size = 0 Then
' show user Calendar in view control
With objCtrl
.Folder = GetCalFolder()
.View = "Events"
.Restriction = "[Subject] = ""Vacation"""
End With
' try to get the name of my manager
strManager = GetMyManagerName()
If strManager <> vbNullString Then
Set objRecip = Item.Recipients.Add(strManager)
objRecip.Resolve
If objRecip.Resolved Then
Set objPage =
Item.GetInspector.ModifiedFormPages("Message")
Set objCtrl = objPage.Controls("txtVacStart")
objCtrl.SetFocus
End IF
End If
Else
With objCtrl
' show public Vacations folder in view control
.Folder = "\" & Replace(mstrVacFolder,"/","\")
.View = "Vacation Month" ' name of custom view
End With
End If
Set objPage = Nothing
Set objCtrl = Nothing
Set objRecip = Nothing
End Function
the past and was unable to complete the project.
I have changed the folder names to reflect mine, and have published the
form to the Org. Forms Lib. w/o the "save definitions" box checked. I'm
running under Outlook 2002.
In my main code as shown below, I get a permission denied error when I
try to set the Folder property of objCtrl. I've checked, and
GetCalFolder returns correctly in a msgbox. I'm sure I'm missing
something simple here, but I just can't get past this. Any help would
be appreciated!!
Thanks!
Function Item_Open()
Dim objPage
Dim objCtrl
Dim objRecip
Dim strManager
Dim strFolderPath
InitOpts
Set objPage = Item.GetInspector.ModifiedFormPages("Vacations")
Set objCtrl = objPage.Controls("OVCtl1")
If Item.Size = 0 Then
' show user Calendar in view control
With objCtrl
.Folder = GetCalFolder()
.View = "Events"
.Restriction = "[Subject] = ""Vacation"""
End With
' try to get the name of my manager
strManager = GetMyManagerName()
If strManager <> vbNullString Then
Set objRecip = Item.Recipients.Add(strManager)
objRecip.Resolve
If objRecip.Resolved Then
Set objPage =
Item.GetInspector.ModifiedFormPages("Message")
Set objCtrl = objPage.Controls("txtVacStart")
objCtrl.SetFocus
End IF
End If
Else
With objCtrl
' show public Vacations folder in view control
.Folder = "\" & Replace(mstrVacFolder,"/","\")
.View = "Vacation Month" ' name of custom view
End With
End If
Set objPage = Nothing
Set objCtrl = Nothing
Set objRecip = Nothing
End Function