
programmatically point to file(s) in Outlook mailbox folder: 2nd post
I thought I posted this last night, but I don't see it this morning; if it
indeed appears twice, please forgive.
Using W98SE, Office 97, Outlook 98:
The original post:
I hope I can explain this. I have an Excel procedure that runs from an
Excel file that (normally) lives in a folder (with group access enabled) in
an Outlook mailbox on a server. The procedure opens up a Word file, or
rather gives the user a choice of Word files via fileToOpen. At present I
keep the Word files in a folder on the local hard drive. This is very
inconvenient from an administrative point of view (maintaining files on
every user's local machine), but it works; the only reason I keep the Word
files there is because I don't know how to programmatically point to a file
that lives in a folder in an Outlook mailbox. The OL user whose mailbox I
want to point to is whoever's machine the file happens to be running on, and
so that part, whatever the syntax might be, needs to be a variable, and I
need to somehow set the variable to whoever's mailbox happens to be open in
the local OL app. This is not an urgent problem, but I'd welcome any
suggestions. Thank you very much.
Additional developments: I found a NEO post on Deja and cobbled
up the code below, which gives me a pointer to a particular folder ("TEST")
in the user's mailbox. The problem now is that user A may be accessing
folder TEST which is in A's own mailbox, while user B might in some cases be
accessing the same folder, TEST, in A's mailbox via permission granted by A
and mailbox added in B's Exchange Server Properties. Setting the reference
accordingly has me stumped. Again, any suggestions would be greatly
appreciated. Thanks!
Dim objApp, objNS, objCustomFolder As Object
Set objApp = New Outlook.Application
Set objNS = objApp.GetNamespace("MAPI")
Set objCustomFolder = objNS.GetDefaultFolder(olFolderInbox)
MsgBox (objCustomFolder)
Set objCustomFolder = objCustomFolder.Parent
Set objCustomFolder = objCustomFolder.Folders("TEST")
MsgBox (objCustomFolder)
--
Michael Williams
University of Rochester