Vacation Form and Views

D

Douglas Cowie

Hello, folks.

I am using Outlook 2002 and Exchange 2000, and the Vacation Reques
Form III (heavily modified). I find that, when using the view contro
to examine the current users calendar folder, the view is set t
"Events", even when the form has been closed and sent. The originatin
users Calendar folder now uses the Events view, irregardless of wha
they were using before.

Is this a known problem, and how do you return the Calendar Folde
view to what it was before?

How can I restrict the managers view (again, using OlVctl) to onl
those personnel that report to him/her? I don't seem to be able t
search the AD to find out who those personnel would be. Ideally, th
manager would only be able to see the events in the "Vacations" publi
folder of those personnel reporting to them.

Help
 
S

Sue Mosher [MVP-Outlook]

You could set the view on the folder with the MAPIFolder.View property,
perhaps when the form closes.
 
D

Douglas Cowie

Well, thanks for the hint, but I don't seem to be able to follow it.
still cannot capture the name of the view that was being used on th
Calendar folder before I changed it to "Events", and therefore canno
return it to it's previous state......
 
S

Sue Mosher [MVP-Outlook]

Is there a reason why you can't capture it before you change the view?

Also note: The newsgroup interface you are using apparently does not quote
earlier messages in the thread, making your latest message so short on
detail that you risk not getting the answer you're looking for. Please take
the time to quote the original message.
 
D

Douglas Cowie

Basically, I don't know how.

Sue Mosher wrote:
Is there a reason why you can't capture it before you change the view?

Doug Cowie wrote:
Well, thanks for the hint, but I don't seem to be able to follow it.
still cannot capture the name of the view that was being used on th
Calendar folder before I changed it to "Events", and therefore canno
return it to it's previous state......
 
D

Douglas Cowie

Basically, I don't know how.

Sue Mosher wrote:
Is there a reason why you can't capture it before you change the view?

Doug Cowie wrote:
Well, thanks for the hint, but I don't seem to be able to follow it.
still cannot capture the name of the view that was being used on th
Calendar folder before I changed it to "Events", and therefore canno
return it to it's previous state......
 
D

Douglas Cowie

Basically, I don't know how.

Sue Mosher wrote:
Is there a reason why you can't capture it before you change the view?

Doug Cowie wrote:
Well, thanks for the hint, but I don't seem to be able to follow it. I
still cannot capture the name of the view that was being used on the
Calendar folder before I changed it to "Events", and therefore cannot
return it to it's previous state.......
 
S

Sue Mosher [MVP-Outlook]

If you're using code to change the view on the Calendar folder, then you can
get the name from MAPIFolder.View or its properties (depending on your
Outlook version) before you change the view.

Also note: The newsgroup interface you are using apparently does not quote
earlier messages in the thread, making your latest message so short on
detail that you risk not getting the answer you're looking for. Please take
the time to quote the original message.
 
D

Douglas Cowie

Hi, Sue.

I am not using code to set the View on the Users Calendar,
except to change it via the OVCtl. When I try to capture
the original view by using
Set objNS = Application.GetNamespace("MAPI")
Set objFolder = objNS.GetDefaultFolder _
(olFolderCalendar)
GetPreviousView = objFolder.View
the script debugger tells me that
"Object doesn't support this property or method:
GetPreviousView = objFolder.View"

What am I doing wrong? All I want to do is find out what
View the user has on his calendar before I modify it with
the Outlook View Control, so I can return it to the way it
was!

Any help appreciated.
 
S

Sue Mosher [MVP-Outlook]

The property you want to use is CurrentView. When in doubt, check the object
browser.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
D

Douglas Cowie

Thanks, Sue.
My next challenge is to get the view of the Calendar
folder when I am not actually in the calendar folder. I'll
see if I can modify the GetCalFolder() to suit.

Doug
 
G

Guest

Here is the function I wrote to get the view.

Function GetCurCalView()
' by Douglas Cowie- May 14 2004
' Returns View currently used on Calendar Folder


Dim objFolder
Dim objNS

Set objNS = Application.GetNamespace("MAPI")
Set objFolder = objNS.GetDefaultFolder
(olFolderCalendar)

GetCurCalView = objFolder.CurrentView


Set objFolder = Nothing
Set objNS = Nothing
End Function

I declare the variable "PreviousView" in the explicit
declarations, and set PreviousView = GetCurCalView() in
the InitOpt sub, and then added the function

Function Item_Send()
' by Douglas Cowie- May 17 2004
' Resets view on Calendar Folder to previous view
' after using OlVCtl
Dim objPage, objCtrl

Set objPage = Item.GetInspector.ModifiedFormPages
("Vacations")
Set objCtrl = objPage.Controls("OVCtl1")
With objCtrl
.Folder = GetCalFolder()
.View = "" & PreviousView & ""
End With

Set objPage = Nothing
Set objCtrl = Nothing
End Function

This seems to work.
 
G

Guest

Here is the function I wrote to get the view.

Function GetCurCalView()
' by Douglas Cowie- May 14 2004
' Returns View currently used on Calendar Folder


Dim objFolder
Dim objNS

Set objNS = Application.GetNamespace("MAPI")
Set objFolder = objNS.GetDefaultFolder
(olFolderCalendar)

GetCurCalView = objFolder.CurrentView


Set objFolder = Nothing
Set objNS = Nothing
End Function

I declare the variable "PreviousView" in the explicit
declarations, and set PreviousView = GetCurCalView() in
the InitOpt sub, and then added the function

Function Item_Send()
' by Douglas Cowie- May 17 2004
' Resets view on Calendar Folder to previous view
' after using OlVCtl
Dim objPage, objCtrl

Set objPage = Item.GetInspector.ModifiedFormPages
("Vacations")
Set objCtrl = objPage.Controls("OVCtl1")
With objCtrl
.Folder = GetCalFolder()
.View = "" & PreviousView & ""
End With

Set objPage = Nothing
Set objCtrl = Nothing
End Function

This seems to work.
 
S

Sue Mosher [MVP-Outlook]

Excellent! Thanks for sharing your success.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top