A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook - Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

VBA shortcut to open custom form in design mode?



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2  
Old March 4th 06, 05:15 PM posted to microsoft.public.outlook.program_forms
Hollis D. Paul
external usenet poster
 
Posts: 66
Default VBA shortcut to open custom form in design mode?

In article , Burma Jones wrote:
There is a custom form that I modify frequently and I was wondering
if there is any way to programmatically open the form in design
mode? Currently I have to go Tools - Forms - Design a Form -
Personal Forms Library - select the form (or double-click) - Open

Well, you can certainly write VBA code to open the form. That would
get half the process done.

Sub SharePointTips()
'Declarations
Dim myItem As ContactItem
Dim myMailItem As MailMessage
Dim myRecip As Recipient
Dim myOlApp As New Outlook.Application
Dim myOlNS As NameSpace
Dim myOlfldr As MAPIFolder
Dim myOlExp As Outlook.Explorer

Set myOlExp = myOlApp.ActiveExplorer
Set myOlNS = myOlApp.GetNamespace("MAPI")
Set myOlfldr = myOlNS.GetDefaultFolder(olFolderContacts)

Set myItem = myOlfldr.Items.Add("IPM.Contact.SharePointTips_Q")
myItem.Display

Set myRecip = Nothing
Set myMailItem = Nothing


'free variables
Set myItem = Nothing
Set myOlNS = Nothing
Set myOlfldr = Nothing
Set myOlApp = Nothing
Set myOlExp = Nothing

End Sub


Put it in the ThisOutlook module. Change the names to reflect your
system.

Hollis D. Paul [MVP - Outlook]
Mukilteo, WA USA



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Design a form gary Outlook - Using Forms 1 February 20th 06 10:31 PM
Code runs in design mode karlman Outlook - Using Forms 2 January 27th 06 06:49 PM
How can I design a task form to have an attachment? SPC Arndt Outlook - Using Forms 4 January 23rd 06 06:51 PM
Delete Custom Outlook Control thru Access VBA Sue Mosher [MVP-Outlook] Outlook - Using Forms 0 January 20th 06 06:29 PM
Cannot programmatically open custom message in custom form ms Outlook - Using Forms 1 January 20th 06 04:01 PM


All times are GMT +1. The time now is 01:13 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.