Button (macro) to open Form from "Orgaization Forms Library"

F

Fabrizio

Hi,

(Running Exchange 5.5 with Outlook 2003 clients)
I've built a few forms using the tips and tricks I found here. Tested them
also running them from my "Personal Forms Library". I even wrote (copied from
microsoft, haha) a macro which I combined with a button on the toolbar.
Clicking it opens of course the form I've built.
After setting everything right, I published the form to the "Organization
Forms Library". My goals is, obviously, to add a toolbar button to all the
clients which enables them to run the form by simply clicking the button.
The only thing is that I can't find out how to write the macro to set the
"myfolder" variable to "Organization Forms Library".

So, in short, this works:
----------------------------------------------------------
Sub Meeting()
Set myFolder = Session.GetDefaultFolder(olFolderInbox)
Set myItem = myFolder.Items.Add("IPM.Appointment.MeetingReq")
myItem.Display
End Sub
----------------------------------------------------------
and this doesn't work:
----------------------------------------------------------
Sub MeetingReq()
Set myFolder1 = Session.Folders("System Folders")
Set myFolder2 = myFolder1.Folders("EFORMS REGISTRY")
Set myFolder3 = myFolder2.Folders("Organization Forms")
Set myItem = myFolder3.Items.Add("IPM.Appointment.MeetingReq")
myItem.Display
End Sub
 
S

Sue Mosher [MVP-Outlook]

The code you have below should work just fine.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
F

Fabrizio

Okay, but running the macro with that code brings up the following error:

---------------------------
Microsoft Visual Basic
---------------------------
Run-time error '-2147221233 (8004010f)':

The operation failed. An object could not be found.
 
S

Sue Mosher [MVP-Outlook]

I guess I was presuming that you had previously instantiated Session as a global Namespace object.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and 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

Top