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 / Contacts / October 2006

Tip: Looking for answers? Try searching our database.

Contact Form Swapping

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
envywaits@gmail.com - 26 Oct 2006 16:31 GMT
I'm using Outlook 2003 and am trying to find a way to have Outlook open
a selected contact item with a customized form.  I already know how to
change the default form for new contacts, and how to programmatically
change the message class of all the existing contact items to use a new
form, but I'm looking for something slightly different.  Here's what I
want the end user to be able to do:

1.  Select a contact in their contacts list.
2.  Click a button on their toolbar that opens the selected contact
with a custom form (assigned in the programming behind the button)

Viewing/Editing a selected contact with a custom form should be
available as an -option-, not a default.

Much appreciated!

--Patrick
Sue Mosher [MVP-Outlook] - 26 Oct 2006 16:35 GMT
You already know the answer, if you think about it: You must change the value of the MessageClass property and save the selected item. Once you do that, you can release the item's object, get it again (use the EntryID), and display it.

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
 

> I'm using Outlook 2003 and am trying to find a way to have Outlook open
> a selected contact item with a customized form.  I already know how to
[quoted text clipped - 13 lines]
>
> --Patrick
envywaits@gmail.com - 26 Oct 2006 17:27 GMT
Yes, I was very close and thank you for the quick response. :)

Now, I'm trying to figure a way to reset the message class to the
default when the contact item is closed.  Any thoughts?

> You already know the answer, if you think about it: You must change the value of the MessageClass property and save the selected item. Once you do that, you can release the item's object, get it again (use the EntryID), and display it.
>
[quoted text clipped - 23 lines]
> >
> > --Patrick
envywaits@gmail.com - 26 Oct 2006 17:29 GMT
Nevermind, I got it!  I'll post the code shortly.

> Yes, I was very close and thank you for the quick response. :)
>
[quoted text clipped - 28 lines]
> > >
> > > --Patrick
envywaits@gmail.com - 26 Oct 2006 17:58 GMT
Here's what I came up with.  I set up a button on the toolbar.  It
takes a selected contact, swaps out the message class so it will
display using a custom form, then resets the message class so persons
who do not need or care to use the custom form won't be troubled by it.

Sub CustomFormViewer()
 Dim objApp As Application
 Dim objItem As Object

 Set objApp = CreateObject("Outlook.Application")
 Set objItem = objApp.ActiveExplorer.Selection.Item(1)

 If objItem.Class = olContact Then
   objItem.MessageClass = "IPM.Contact.CC_ContactForm02"
       objItem.Save
   Set objItem = objApp.ActiveExplorer.Selection.Item(1)
       objItem.Display
   objItem.MessageClass = "IPM.Contact"
       objItem.Save
 End If

 Set objItem = Nothing
 Set objApp = Nothing

End Sub

> Nevermind, I got it!  I'll post the code shortly.
>
[quoted text clipped - 30 lines]
> > > >
> > > > --Patrick
 
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.