Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming Forms / July 2006

Tip: Looking for answers? Try searching our database.

Linking to Forms via HTML -- If not installed, it opens blank e-mail

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David Hampson - 25 Jul 2006 00:46 GMT
Here's some background:

I've created some VBScript on a web page that takes a path to a form in the
Public Folders, parses it out, traverses the folders to the one containing a
form, and then opens the form.

For those who have tried to do this and failed, I don't have the code in
front of me (I'm at home, can't get to newsgroups directly at work) but I
pass the path as a string with ^s as separators (Because hopefully nobody
names a Public Folder with a ^ in it) like this:

"Public Folders^Folder1^Folder2^Folder3^FormName"

I then split that into an array, and use a For Next loop to the UBound -1 to
traverse the folders.

I then open the Form using mailitem = folder.items.add("IPM.Note." &
Array(Ubound(Array)))

This works great, IF the user has this form installed in their Outlook. If
not, they get a standard blank e-mail message.

What I need is code to install the form locally before it tries to open it.
I did some Google searches at work today, and found a couple of snippets,
but couldn't really translate that into what I needed.

Any ideas?

Thanks,

Dave Hampson

P.S. If anyone wants the VBScript that parses the Path to open a form buried
inside Public Folders, let me know, I can mail it home and post it.
Sue Mosher [MVP-Outlook] - 25 Jul 2006 01:07 GMT
Did you look at the FormDescription.PublishForm method? See http://www.outlookcode.com/d/distributeforms.htm 
Signature

Sue Mosher, Outlook MVP
  Author of Configuring Microsoft Outlook 2003
    http://www.turtleflock.com/olconfig/index.htm
  and Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx
 

> Here's some background:
>
[quoted text clipped - 30 lines]
> P.S. If anyone wants the VBScript that parses the Path to open a form buried
> inside Public Folders, let me know, I can mail it home and post it.
David Hampson - 25 Jul 2006 04:15 GMT
Sue,

I saw that earlier, and I've got that in my code, but didn't have a chance
to test it before I left work. I wasn't sure it would work because I was
opening a form from a Public Folder and not from an OFT file. My code has
the mailitem.formdescription.publishform(2) line right after the
mailitem.items.add(IPM.Note.Formname) line. I have a feeling that won't
work, but I'll try it tomorrow morning.

Thanks,

Dave H.
Did you look at the FormDescription.PublishForm method? See
http://www.outlookcode.com/d/distributeforms.htm
Signature

Sue Mosher, Outlook MVP
  Author of Configuring Microsoft Outlook 2003
    http://www.turtleflock.com/olconfig/index.htm
  and Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx

> Here's some background:
>
[quoted text clipped - 35 lines]
> buried
> inside Public Folders, let me know, I can mail it home and post it.
TowerDave - 25 Jul 2006 17:11 GMT
Sue,

I tried this, but since the form isn't installed yet locally, it just
opens a blank e-mail. I went into the Personal Forms Library, and the
form was listed. When I double-clicked, it installed it then. I need my
code to force that installation so it will then open the correct form,
and not a blank e-mail.

Any more ideas?

Here is my code. (I am a new Google Groups fan. I can get to this group
through there)

Sub OpenOutlookDoc(FolderPath)

 aFolders = Split(FolderPath, "^")

 Set objOutlook = CreateObject("Outlook.Application")
 Set objNS = objOutlook.GetNamespace("MAPI")

 Set fldr = objNS.Folders(aFolders(0))

 For i = 1 To UBound(aFolders) - 1
   Set fldr = fldr.Folders(aFolders(i))
   'msgbox(aFolders(i))
   'check for errors
   If Err <> 0 Then Exit Sub
 Next
 'msgbox(FormName)
 set mailitem = fldr.items.add("IPM.Note." &
aFolders(UBound(aFolders)))
 mailitem.formdescription.displayname = aFolders(UBound(aFolders))
 mailitem.formDescription.publishform(2)
 mailitem.display(0)

End Sub
-->

And the folder path I am passing is formatted as I stated above.

Thanks,

Dave Hampson

> Did you look at the FormDescription.PublishForm method? See http://www.outlookcode.com/d/distributeforms.htm
> --
[quoted text clipped - 39 lines]
> > P.S. If anyone wants the VBScript that parses the Path to open a form buried
> > inside Public Folders, let me know, I can mail it home and post it.
Sue Mosher [MVP-Outlook] - 25 Jul 2006 17:23 GMT
If you're using a statement like this to create the item:

   set mailitem = fldr.items.add("IPM.Note." & aFolders(UBound(aFolders)))

it should work ***if*** the form is published in the folder represented by the fldr variable.

Signature

Sue Mosher, Outlook MVP
  Author of Configuring Microsoft Outlook 2003
    http://www.turtleflock.com/olconfig/index.htm
  and Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx
 

> Sue,
>
[quoted text clipped - 76 lines]
>> > P.S. If anyone wants the VBScript that parses the Path to open a form buried
>> > inside Public Folders, let me know, I can mail it home and post it.
TowerDave - 25 Jul 2006 21:49 GMT
Sue,

The form is published to the Public Folders, and if I go to Tools,
Choose Form, and double-click on the form from the Public Folders which
causes it to be installed to my machine and THEN click on the link, it
works fine. If a user clicks the link before doing that, it just opens
a standard blank e-mail message. That is my issue. Obviously we would
rather not have to install all of these forms locally, but would rather
have the code on the web site take care of that.

I really appreciate any assistance you can provide.

Thanks,

Dave Hampson

> If you're using a statement like this to create the item:
>
[quoted text clipped - 90 lines]
> >> > P.S. If anyone wants the VBScript that parses the Path to open a form buried
> >> > inside Public Folders, let me know, I can mail it home and post it.
Sue Mosher [MVP-Outlook] - 25 Jul 2006 22:44 GMT
Oh, yuck.

Here's a possible alternative -- store the form as an .oft file free doc in the folder, then use your code to save the free doc Attachment as a file, invoke the .oft with CreateItemWithTemplate and use the resulting MailItem to publish the form.

Signature

Sue Mosher, Outlook MVP
  Author of Configuring Microsoft Outlook 2003
    http://www.turtleflock.com/olconfig/index.htm
  and Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx
 

> Sue,
>
[quoted text clipped - 98 lines]
>> >> > P.S. If anyone wants the VBScript that parses the Path to open a form buried
>> >> > inside Public Folders, let me know, I can mail it home and post it.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.