custom journal form accessed from contact activities selection...?

G

Guest

First of all I'm new to programming outlook2003...(just want to get that
out...)

I have spent several trial and error hours trying to get my published
Journal form to be used when I double click a Journalitem from the contacts
activities page...and have finally given up. It works from the journal
folder...but of course I've set up the default folder to use my form. I have
not been able to find a way to set the custom form to popup...from the
contacts folder or from the menu bar "new journal item..."...

So I have resorted to creating an addin with a windows form. So far as I
can tell...this will work. But I'm wondering if this is an ok approach? Has
any one seen any negative results from this approach?

my addin code...

private withevents _journalItem as Outlook.JournalItem
private withevents _inspectors as Outlook.Inspectors
private withevents _inspector as Outlook.Inspector

Private Sub Application_Startup() Handles Application.Startup
_inspectors = Globals.ThisAddIn.Application.Inspectors
end sub

Private Sub _inspectors_NewInspector(byval Inspector as
Microsoft.Office.Interop.Outlook.Inspector) Handles _inspectors.NewInspector
Try
_inspector = _inspectors.Item(_inspectors.count)
_journalItem = Ctype(_inspector.CurrentItem, Outlook.JournalItem)
Catch ex as Exception
End try
end sub

Private Sub _journalItemOpen (byref cancel as Boolean) Handles
_journalItem.Open
_journalItem.close(Outlook.OlInspectorClose.olDiscard)
Dim myJournalWindowsForm as new JournalForm(_journalItem)
myJournalWindowsForm.show()
end sub

So anytime an inspector is opened...I check for a journal item. If I find
one...then I get the reference and assign my journalitem object. I then
close the default journalitem (inspector) before it's opened. And finally
pass my journalitem object to my custom windows form....I then take care of
displaying and handling updating the journalitem data...within the form...and
pass back the changes via properties.

Any feed back is appreciated....thanks.
 
S

Sue Mosher [MVP-Outlook]

Your add-in approach should work, but you also can make a registry change to substitute your published custom form for the default journal form. See http://www.outlookcode.com/d/newdefaultform.htm#changedefault ..

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top