Setting OVC folder in Outlook 2003 doesn't work

  • Thread starter Thread starter Vlad Lubarda
  • Start date Start date
V

Vlad Lubarda

I have a home page in Outlook that uses the Outlook View control. I
set the Outlook View control's folder in script using the following
code:

oViewControl.Folder = FullPath

where FullPath is function that returns the full path to the folder
and looks like:

"\\Mailbox - Administrator\My New Folder\"

This works fine in Outlook 2000 but in Outlook 2003 I get the
following error:

Internet Explorer Script Error: error has occurred in the script on
this page line ... (the line that has the code above)
Could not complete the operation due to error a0f20009.

Is there another way you're supposed to set the folder value in
Outlook 2003? Is this some sort of permissions issue? Any
information would be greatly appreciated.
 
What happens if you strip one or both leading \ characters from the path
string?
 
Thanks for the quick reply Sue.

I tried removing the \ character(s) as you suggested and I get the
same error. Is there possibly another property I need to set prior to
setting the folder in Outlook 2003?

Here is a stripped down version of the source in case that would be of
any help:

<%@ Language=VBScript%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET
7.1">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</head>
<body> <!-- <form id="Form1" method="post" runat="server"> -->
<OBJECT id="oViewControl" style="Z-INDEX: 101; LEFT: 7px;
POSITION: absolute; TOP: 60px"
height="85%" width="98%"
classid="clsid:0006F063-0000-0000-C000-000000000046" VIEWASTEXT>
<PARAM NAME="View" VALUE="">
<PARAM NAME="Folder" VALUE="">
<PARAM NAME="Namespace" VALUE="MAPI">
<PARAM NAME="Restriction" VALUE="">
<PARAM NAME="DeferUpdate" VALUE="0">
</OBJECT>

<script language="vbscript" id="clientEventHandlersVBS">

Set oApplication = window.external.OutlookApplication
'Set oNS = oApplication.GetNamespace("MAPI")
Set oCurrentFolder = oApplication.activeExplorer.currentfolder

'******************************************************
'Function StrFullPath()
'
'This function creates and returns the full path to the
'folder
'******************************************************
function StrFullPath()
strFolderName = ""
Set olRoot = oCurrentFolder
While (olRoot <> "Mapi")
strFolderName = oCurrentFolder.Name & "\" & strFolderName
Set olRoot = oCurrentFolder.Parent
If olRoot <> "Mapi" Then
Set oCurrentFolder = oCurrentFolder.Parent
End If
Wend
strFullPath = "\\" & strFolderName
end Function

Fullpath = StrFullPath()
msgbox Fullpath
oViewControl.Folder = FullPath

-->
</SCRIPT>
</body>
</html>
 
Back
Top