programatically access a form in your personal forms folder

  • Thread starter Thread starter dh
  • Start date Start date
D

dh

I use the following code, that is linked from a button on a custom Outlook
form to launch another form:

Set objFolder = Application.ActiveExplorer.CurrentFolder
Set objItem = _
objFolder.Items.Add("IPM.Note.ORDER Request Message")
objItem.Display

This works when online (the form is also on the company organization form
folder) , even if I have the form in my personal forms folder. What do I
need to do so that it will work offline as well.
Thanks!
DH
 
You are using Exchange? Is the setting for downloading custom forms for
offline use set?

You don't say which version of Outlook you are using and how to set that
depends on your Outlook version. That will let you use your forms offline
when using the OST file for your Exchange setup.
 
Yes, we use an exchange server, sorry that I didn't include this info.
We use both Outlook 2000 and 2003
Thanks!
DH
 
Always provide the Outlook version, things are way different for many
settings in different versions of Outlook :)

For Outlook 2003: Use the keyboard shortcut Ctrl+Alt+S to open the
Send/Receive Groups dialog. Select each group in turn and click Edit. Check
the Synchronize forms checkbox and click OK. Close the dialog and use F9 to
synch things.

For Outlook 2000: Tools, Synchronize, Offline Folder Settings. In that
dialog check the Synchronize forms checkbox and click OK. Close the dialog
and use F9 to synch things.
 
I have those setting correct but I still get the following error message:
Object Required: 'Application.ActiveExplorer'
Any clues?
Thanks!
DH
 
Is Outlook showing an Explorer (folder view)? For forms code Application
should return an Outlook.Application object and you could check in debug
mode in the form whether or not you are getting that object and how many
Explorers are in the Explorers collection and if ActiveExplorer Is Nothing.
That's about all I can think of at the moment.
 
If I were to put a copy of the custom form I want to open in a folder on a
persons computer, what code
would I have to use to open and access it from my custom form?
Thanks for you help, BTW!!!
I appreciate it!
DH
 
Assuming both custom forms are published on the target system you would
generally use the Add method for the Items collection of the folder you want
to use with the form:
Set myItem = oFolder.Items.Add("IPM.Note.MyForm")
where the custom message class is whatever you're using.

If both forms aren't published then that's a different story. You would need
to use an OFT file for the second form and open it from the file system and
publish it using code and then it could be run. Unpublished forms with code
won't run in Outlook 2003 (and I think Outlook 2002 SP3 but I haven't played
with that on that version, I always publish using code anyway).
 
So what would I use for code just to launch a form, in the .oft format. from
a folder on pc?
Thanks
DH
 
You use the CreateItemFromTemplate method for that but your form code, if
there is any, wouldn't run from an item created that way.
 
Sue has a list of Outlook development books on her Web site at
www.outlookcode.com

For beginners I highly recommend her latest book. For more advanced users
I'd recommend Randy Byrne's Building Applications with Outlook 2002 book
from MS Press if it's still around in print or one of Tim Rizzo's books,
also from MS Press. Most of the other development books for earlier versions
of Outlook are now out of print, including my own.
 
You been of great help!
Thanks a bunch!
DH
Ken Slovak - said:
Sue has a list of Outlook development books on her Web site at
www.outlookcode.com

For beginners I highly recommend her latest book. For more advanced users
I'd recommend Randy Byrne's Building Applications with Outlook 2002 book
from MS Press if it's still around in print or one of Tim Rizzo's books,
also from MS Press. Most of the other development books for earlier versions
of Outlook are now out of print, including my own.
 
Back
Top