From: microsoft on 9 Apr 2010 09:03 I've got the following sub that is intended to open a new Explorer and display the specified folder. It works on my home laptop but when I try to use it on a machine connected to Exchange it craps out. The problem appears to be at this line where the object is not being instantiated. Any Ideas? [set objNamespace = objOutlook.GetNamespace("MAPI")] sub displayFolder(sourceObject) 'Display the folder in a new Explorer window set objOutlook = ObjectCenterTopOutlookViewControl.outlookApplication set ovc = document.getElementById(sourceObject) 'From http://www.outlookcode.com/d/code/getfolder.htm Dim aFolders Dim fldr Dim i Dim objNS set objNamespace = objOutlook.GetNamespace("MAPI") 'On Error Resume Next strFolderPath = Replace(ovc.folder,"\\","") strFolderPath = Replace(strFolderPath, "/", "\") aFolders = Split(strFolderPath, "\") 'get the Outlook objects 'set the root folder Set fldr = objNamespace.Folders(aFolders(0)) 'loop through the array to get the subfolder 'loop is skipped when there is only one element in the array For i =1 To UBound(aFolders) Set fldr = fldr.Folders(aFolders(i)) 'check for errors If Err <> 0 Then msgbox(Err.number & " " & Err.Description) Exit Sub end if Next Set GetFolder = fldr ' de-reference objects Set objNS = Nothing GetFolder.display set objExplorer = GetFolder.GetExplorer 'Hide preview pane objExplorer.ShowPane 3, False 'Hide navigation pane objExplorer.ShowPane 4, False 'Hide Todo pane objExplorer.ShowPane 5, False end sub
From: microsoft on 9 Apr 2010 09:10 Nevermind. It was a problem with the Picnic configuration. Damn I wish MS would remove that configuration file. "microsoft" <david.c.holley(a)mailserver.us.duh> wrote in message news:ONLPFU%231KHA.3868(a)TK2MSFTNGP06.phx.gbl... > I've got the following sub that is intended to open a new Explorer and > display the specified folder. It works on my home laptop but when I try to > use it on a machine connected to Exchange it craps out. The problem > appears to be at this line where the object is not being instantiated. Any > Ideas? > > [set objNamespace = objOutlook.GetNamespace("MAPI")] > > sub displayFolder(sourceObject) > > 'Display the folder in a new Explorer window > > set objOutlook = ObjectCenterTopOutlookViewControl.outlookApplication > set ovc = document.getElementById(sourceObject) > > 'From http://www.outlookcode.com/d/code/getfolder.htm > > Dim aFolders > Dim fldr > Dim i > Dim objNS > > set objNamespace = objOutlook.GetNamespace("MAPI") > 'On Error Resume Next > strFolderPath = Replace(ovc.folder,"\\","") > strFolderPath = Replace(strFolderPath, "/", "\") > aFolders = Split(strFolderPath, "\") > > 'get the Outlook objects > > 'set the root folder > Set fldr = objNamespace.Folders(aFolders(0)) > > 'loop through the array to get the subfolder > 'loop is skipped when there is only one element in the array > For i =1 To UBound(aFolders) > Set fldr = fldr.Folders(aFolders(i)) > 'check for errors > If Err <> 0 Then > msgbox(Err.number & " " & Err.Description) > Exit Sub > end if > Next > > Set GetFolder = fldr > > ' de-reference objects > Set objNS = Nothing > > GetFolder.display > set objExplorer = GetFolder.GetExplorer > 'Hide preview pane > objExplorer.ShowPane 3, False > 'Hide navigation pane > objExplorer.ShowPane 4, False > 'Hide Todo pane > objExplorer.ShowPane 5, False > > > end sub > >
|
Pages: 1 Prev: Upgrade from Outlook 3007 to Outlook 2007 Next: Apply Class Attribute to OVC |