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 VBA / May 2008

Tip: Looking for answers? Try searching our database.

Button To Open Template - Outlook 2007

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
garfong - 26 Mar 2008 22:39 GMT
I need to create a button on the toolbar that will open a template stored in
the office\templates directory. I tried creating a button that hyperlinked to
the template but Outlook has decided such a move is dangerous and once the
user gets past all the warnings, the template comes up blank because outlook
has blocked all the functionality.

Any ideas how I can use VBA to get past the annoying prompts and get the
button to open the template directly? In effect, the button would recreate
the steps of going to File > New > Choose Form > Look In: User Templates In
File System > Open test.otf
Sue Mosher [MVP-Outlook] - 26 Mar 2008 22:45 GMT
Write a macro that calls the Application.CreateItemFromTemplate method:

Sub MakeItem()
   Set newItem = Application.CreateItemFromTemplate("c:\your path\open test.oft")
   newItem.Display
   Set newItem = Nothing
End Sub

Signature

Sue Mosher, Outlook MVP
  Author of Microsoft Outlook 2007 Programming:
    Jumpstart for Power Users and Administrators
   http://www.outlookcode.com/article.aspx?id=54

>I need to create a button on the toolbar that will open a template stored in
> the office\templates directory. I tried creating a button that hyperlinked to
[quoted text clipped - 6 lines]
> the steps of going to File > New > Choose Form > Look In: User Templates In
> File System > Open test.otf
garfong - 26 Mar 2008 23:03 GMT
Wow! You're good!

That worked like a charm. Thanks a million!

> Write a macro that calls the Application.CreateItemFromTemplate method:
>
[quoted text clipped - 14 lines]
> > the steps of going to File > New > Choose Form > Look In: User Templates In
> > File System > Open test.otf
PeterHS - 20 Apr 2008 18:51 GMT
Is this also possible to do this with forms i published? The last 4 hours I
tried to put "olformregistry" and "olorganizationregistry" in the command,
but I can't get it to work.

Or as a alternative to open the dialog with standard the public forms?

Or are i'm searching for something that is imposible. What I want is for
users to "with one button to choose from I list off published forms for
sending e-mail".

Manny thanks

Peter

> Write a macro that calls the Application.CreateItemFromTemplate method:
>
[quoted text clipped - 14 lines]
> > the steps of going to File > New > Choose Form > Look In: User Templates In
> > File System > Open test.otf
Sue Mosher [MVP-Outlook] - 21 Apr 2008 14:23 GMT
To create a new instance of a custom form programmatically, use the Add method on the target folder's Items collection:

   Set newItem = targetFolder.Items.Add("IPM.Post.YourFormName")

If it's a message form, use the Drafts folder as the target. If the target is a default folder, you can use the Namespace.GetDefaultFolder method to return it as a MAPIFolder object. To create an item in another person's mailbox, use Namespace.GetSharedDefaultFolder to get the MAPIFolder Otherwise, you can use the code at http://www.outlookcode.com/d/code/getfolder.htm to walk the folder hierarchy and return the MAPIFolder corresponding to a given path string.

See http://www.outlookcode.com/article.aspx?id=56 for other ideas.

BTW, using a published custom form to send messages outside an Exchange organization can cause problems with attachments for the recipients.
Signature

Sue Mosher, Outlook MVP
  Author of Microsoft Outlook 2007 Programming:
    Jumpstart for Power Users and Administrators
   http://www.outlookcode.com/article.aspx?id=54

> Is this also possible to do this with forms i published? The last 4 hours I
> tried to put "olformregistry" and "olorganizationregistry" in the command,
[quoted text clipped - 28 lines]
>> > the steps of going to File > New > Choose Form > Look In: User Templates In
>> > File System > Open test.otf
Walter - 08 Apr 2008 16:14 GMT
Here is a very simple solution:
1)Customize menu (right click in menu bar)
2)click en "rearrange commands"
3)Select any menu bar (may be you can create a new one)
4)Add a button.
5)click in "modify selection"
6)Edit Hyperlink
7)choose existing file and select your .oft file.

I hope this help you.
See you.

> I need to create a button on the toolbar that will open a template stored in
> the office\templates directory. I tried creating a button that hyperlinked to
[quoted text clipped - 6 lines]
> the steps of going to File > New > Choose Form > Look In: User Templates In
> File System > Open test.otf
Sue Mosher [MVP-Outlook] - 08 Apr 2008 17:20 GMT
That won't work in Outlook 2007, in my experience.

Signature

Sue Mosher, Outlook MVP
  Author of Microsoft Outlook 2007 Programming:
    Jumpstart for Power Users and Administrators
   http://www.outlookcode.com/article.aspx?id=54

> Here is a very simple solution:
> 1)Customize menu (right click in menu bar)
[quoted text clipped - 18 lines]
>> the steps of going to File > New > Choose Form > Look In: User Templates In
>> File System > Open test.otf
vliex - 22 May 2008 09:37 GMT
Thank you.
I tried this in outlook 2007 and this works fine.

Rene

> Here is a very simple solution:
> 1)Customize menu (right click in menu bar)
[quoted text clipped - 18 lines]
> > the steps of going to File > New > Choose Form > Look In: User Templates In
> > File System > Open test.otf
 
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.