|
|
 |
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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

June 19th, 2009, 07:01 PM
|
|
Authorized User
|
|
Join Date: Aug 2004
Location: Burbank, CA, USA.
Posts: 93
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
Endclass
__________________
*******(*)*******
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |