A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook - General Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Problem with VBScript Running on Custom Home Page



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old April 9th 10, 02:03 PM posted to microsoft.public.outlook
microsoft
external usenet poster
 
Posts: 3
Default Problem with VBScript Running on Custom Home Page

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.outlookApplicati on
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


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
home page of Outlook jean Outlook - General Queries 1 March 20th 10 09:47 AM
Appointment Body on Custom Page 2- Hide Default Page nuberbc Outlook - Using Forms 2 January 19th 10 11:52 PM
Folder Home Page BryanC Outlook - Using Forms 3 February 20th 09 06:01 PM
Home Page Re-Direct WonhungLo Outlook Express 2 April 29th 07 01:32 AM
running regsvr32.exe vbscript.dll does not help me open outlook Mossy and Madam Outlook - Installation 3 May 11th 06 07:09 PM


All times are GMT +1. The time now is 05:03 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.