Wrox Programmer Forums
|
BOOK: Professional Outlook 2007 Programming ISBN: 978-0-470-04994-5
This is the forum to discuss the Wrox book Professional Outlook 2007 Programming by Ken Slovak; ISBN: 9780470049945
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Outlook 2007 Programming ISBN: 978-0-470-04994-5 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 19th, 2009, 06:01 PM
Authorized User
 
Join Date: Aug 2004
Posts: 95
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Arsi
Unhappy Issue with commandbar with Outlook 2003

Hi there,

I wrote this a while ago and now it is no longer working. The commandbar gets created with the proper item, except when you click on it, nothing happens.

I think the problem is the following line:

_fpItems = _mapiFormsFolder1.Items
_fpItem = _fpItems.Add("IPM.Note.Custom Form")

for _mapiFormsFolder1.Items, under the ErrorCode it shows -1213988351. I've tried searching for that error, but I can't find anything about it. Any ideas what that means?

Also, I see the following message
"Item = In order to evaluate an indexed property, the property must be qualified and the arguments must be explicitly supplied by the user."

I don't know what to do to fix this. Any help would be greatly appreciated. Thank you in advance.

Arsi

Here's the code below:

Imports
Office = Microsoft.Office.Core
Imports System.Xml
Imports System.IO
Imports System.Configuration
Imports System.Collections
Imports System.Net
publicclass ThisApplication
PrivateWithEvents _Explorers As Outlook.Explorers
PrivateWithEvents _Explorer As Outlook.Explorer
Private _mapiFormsFolder1 As Outlook.MAPIFolder
Private _fpItems As Outlook.Items
Private _fpItem AsObject
Private _helpMenuIndex AsObject
Private _topMenu As Office.CommandBarPopup
PrivateWithEvents _OpenForm As Office.CommandBarButton
Private _menuBar As Office.CommandBar
PrivateConst _MENU_BEFORE AsString = "Help"
PrivateSub ThisApplication_Startup(ByVal sender AsObject, ByVal e As System.EventArgs) HandlesMe.Startup
_Explorer =
Me.ActiveExplorer()
_mapiFormsFolder1 =
Me.ActiveExplorer().Session.GetDefaultFolder(Outlook .OlDefaultFolders.olPublicFoldersAllPublicFolders) .Folders("CORPORATE").Folders("Our Forms")
BuildTopMenu()
EndSub
PrivateSub BuildTopMenu()
_menuBar =
Me.ActiveExplorer().CommandBars.ActiveMenuBar
_helpMenuIndex = _menuBar.Controls(_MENU_BEFORE).Index
_topMenu =
CType(_menuBar.Controls.Add(Office.MsoControlType.msoCo ntrolPopup, , , _helpMenuIndex, True), Office.CommandBarPopup)
_topMenu.Caption =
"Our Forms"
_topMenu.Visible = True
_OpenForm = CType(_topMenu.Controls.Add(Office.MsoControlType.msoCo ntrolButton, , , , True), Office.CommandBarButton)
_OpenForm.Caption =
"Custom Form"
_OpenForm.Visible = True
_OpenForm.Enabled = True
EndSub
PrivateSub Menu_Click(ByVal Ctrl As Microsoft.Office.Core.CommandBarButton, ByRef CancelDefault AsBoolean) Handles _OpenForm.Click
Try
_fpItems = _mapiFormsFolder1.Items
_fpItem = _fpItems.Add(
"IPM.Note.Custom Form")
Catch ex As Exception
MessageBox.Show(ex.Message)
EndTry
EndSub
PrivateSub ThisApplication_Shutdown(ByVal sender AsObject, ByVal e As System.EventArgs) HandlesMe.Shutdown
EndSub
End
class
__________________
*******(*)*******





Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook 2003 Angel_oct11 C# 2005 2 November 13th, 2007 07:08 AM
Javascript in Outlook (2003) message POTSJ Javascript How-To 2 October 10th, 2007 07:38 AM
Outlook 2003 Hunter Pro VB.NET 2002/2003 0 January 5th, 2005 06:01 PM
Popup type CommandBar in Outlook sumit_kalra Access VBA 1 September 25th, 2004 11:56 AM
Popup type CommandBar into Outlook sumit_kalra Excel VBA 0 July 10th, 2003 06:20 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.