bcm >> adding toobar item for business note creation

by Ed Marmon » Thu, 15 Feb 2007 22:32:43 GMT

i make lots of notes for business contacts, or at least trying to. i need
them linked. so in the list usually i right click on the b-contacts, select
create, then business note. i want to just have an icon in a custom toolbar
to do this. i cant.

im trying to customize a new "custom1" toolbar i just made, and im in the
commands tab of the customize toolbar dialog. there are limited business
contact options. i can find create journal, but no create business note.
how do i access a lot of the BCM commands so they can be placed on the
toolbar? thanks


bcm >> adding toobar item for business note creation

by Clinton Ford [MSFT] » Fri, 16 Feb 2007 05:55:23 GMT


o create this button on your Outlook toolbar:
1.) Verify that your security settings will prompt you to run unsigned
macros by selecting "Tools | Trust Center..." from the main Outlook window.
Then click "Macro Security" and select "Warnings for all macros" and click
"OK"
2.) Create a Macro from the main Outlook window by selecting "Tools | Macro
| Macros..."
3.) Type "Note" as the Macro Name, then click "Create"
4.) The Visual Basic editing window will open. On the left-hand side is a
project navigation pane. Right-click on the top-level item named "Project1"
and select "Project1 Properties..."
5.) Change "Project1" to "Business" and click "OK"
6.) In the main code area, you'll see "Sub Note()", followed by "End Sub".
Replace those two lines with the VBA code below, then click Save.
7.) Close the Visual Basic window to return to Outlook
8.) Right-click on the Outlook toolbar and click "Customize..."
9.) Select the "Commands" tab, select the "Macro" from the Categories list,
then drag "Business.Note" to the standard Outlook toolbar and click "Close"
on the "Customize" dialog.
10.) Select a business contact or account, then click the "Business.Note"
button.

' Create a New Business Note for the selected Business Contact
Sub Note()
' Get a reference to the MAPI namespace
Dim objNS As Outlook.NameSpace
Set objNS = Application.GetNamespace("MAPI")

' Get a reference to the currently selected Outlook folder
Dim currentFolder As Outlook.Folder
Set currentFolder = Application.ActiveExplorer.currentFolder

' Make sure at least one item is selected
If Application.ActiveExplorer Is Nothing Then
MsgBox "Please select an item"
Exit Sub
End If
If Application.ActiveExplorer.selection Is Nothing Then
MsgBox "Please select an item"
Exit Sub
End If

' Get a reference to the currently selected item
Dim oItem As Object
Set oItem = Application.ActiveExplorer.selection(1)
If oItem Is Nothing Then
MsgBox "Please select an item"
Exit Sub
End If

' Get the selected item's EntryID
Dim parentEntryID As String
' Verify that this item is located in the Business Contact Manager
Outlook store
If 1 = InStr(1, currentFolder.FullFolderPath, "\\Business Contact
Manager\", vbTextCompare) Then
Set oContact = Application.ActiveExplorer.selection(1)
' Only get the EntryID if this is a Business Contact, Account,
Opportunity, or Business Project
If oItem.MessageClass = "IPM.Contact.BCM.Contact" Or _
oItem.MessageClass = "IPM.Contact.BCM.Account" Or _
oItem.MessageClass = "IPM.Task.BCM.Opportunity" Or _
oItem.MessageClass = "IPM.Task.BCM.Project" Then
parentEntryID = oItem.EntryID
End If
End If

' If we didn't find a valid EntryID, notify the user
If parentEntryID = "" Then
MsgBox "Please select a Business Contact, Account, Opportunity, or
Business Project"
Exit Sub
End If

' Get the root BCM folder
Dim olFolders As Outlook.Folders
Dim bcmRootFolder As Outlook.Folder
Set olFolders = objNS.Session.Folders
Set bcmRootFolder = olFolders("Business Contact Manager")

' Locate the Communication History folder
Dim historyFolder As Outlook.Folder
Set historyFolder = bcmRootFolder.Folders("Communication History")

' Cre


bcm >> adding toobar item for business note creation

by Ed Marmon » Fri, 16 Feb 2007 10:12:59 GMT

Unbelievable. Wow. I did it. Thanks.

I wish it weren't so darn tootin' difficult...

Is there a reason why so many commands are eaily added to the toolbar,
and this one takes a page of hocus-pocus?

I wish there was a central repository of these ( what should be ) simple
modifications, code snippets clearly categorized. Im not qualified to go
to a visual basic web site and sift through the details, it's just so
daunting.

Thanks again

PS- is there a way for me to back this up in case I need to later
reinstall office? on that same note- what's the way to back up email
account settings in outlook for the same reason? I tried the registry
route and it screwed things up ( i.e. wouldnt send and receive )... I
know the 2nd question here is n outlook question, but humor me if you
have 30 seconds.... Thanks for the help, makes BCM much more usable for
Act! refugees...


"Clinton Ford [MSFT]" < XXXX@XXXXX.COM > wrote




adding toobar item for business note creation

by Ed Marmon » Fri, 16 Feb 2007 11:10:07 GMT

PS- it doesnt work, throws error. I pasted exactly.

"compile error - expected variable or procedure, not project"

the word "outlook" is highlighted (in black), the one first in line,
like, 25-30-ish. I hit ok, then there's yellow around the 2nd line "Sub
Note()"

???



"Clinton Ford [MSFT]" < XXXX@XXXXX.COM > wrote




adding toobar item for business note creation

by Clinton Ford [MSFT] » Sat, 17 Feb 2007 01:40:54 GMT

he line-wrapping in the newsgroup caused my long comment lines to be
interpreted as code.
In Outlook, press ALT+F11 to bring up the Visual Basic window.
Then replace the "Sub Note() ... End Sub" code with the following:

'////////////////////////////////////////////////////////////////////////
' Create a New Business Note for the selected Business Contact
Sub Note()
' Get a reference to the MAPI namespace
Dim objNS As Outlook.NameSpace
Set objNS = Application.GetNamespace("MAPI")

' Get a reference to the currently selected Outlook folder
Dim currentFolder As Outlook.Folder
Set currentFolder = Application.ActiveExplorer.currentFolder

' Make sure at least one item is selected
If Application.ActiveExplorer Is Nothing Then
MsgBox "Please select an item"
Exit Sub
End If
If Application.ActiveExplorer.selection Is Nothing Then
MsgBox "Please select an item"
Exit Sub
End If

' Get a reference to the currently selected item
Dim oItem As Object
Set oItem = Application.ActiveExplorer.selection(1)
If oItem Is Nothing Then
MsgBox "Please select an item"
Exit Sub
End If

' Get the selected item's EntryID
Dim parentEntryID As String
' Verify that this item is located in the Business Contact
' Manager Outlook Store
If 1 = InStr(1, currentFolder.FullFolderPath, _
"\\Business Contact Manager\", vbTextCompare) Then
Set oContact = Application.ActiveExplorer.selection(1)
' Only get the EntryID if this is a Business Contact, Account,
' Opportunity, or Business Project
If oItem.MessageClass = "IPM.Contact.BCM.Contact" Or _
oItem.MessageClass = "IPM.Contact.BCM.Account" Or _
oItem.MessageClass = "IPM.Task.BCM.Opportunity" Or _
oItem.MessageClass = "IPM.Task.BCM.Project" Then
parentEntryID = oItem.EntryID
End If
End If

' If we didn't find a valid EntryID, notify the user
If parentEntryID = "" Then
MsgBox "Please select a Business Contact, Account, " & _
"Opportunity, or Business Project"
Exit Sub
End If

' Get the root BCM folder
Dim olFolders As Outlook.Folders
Dim bcmRootFolder As Outlook.Folder
Set olFolders = objNS.Session.Folders
Set bcmRootFolder = olFolders("Business Contact Manager")

' Locate the Communication History folder
Dim historyFolder As Outlook.Folder
Set historyFolder = bcmRootFolder.Folders("Communication History")

' Create a new history item
Const BusinessNoteMessageClass = "IPM.Activity.BCM.BusinessNote"
Dim newBusinessNote As Outlook.JournalItem
Set newBusinessNote = historyFolder.Items.Add(BusinessNoteMessageClass)
' Set the type to Business Note
newBusinessNote.Type = "Business Note"

' Link the new Business Note to the selected BCM item
Dim parentEntityEntryID As Outlook.UserProperty
Set parentEntityEntryID = _
newBusinessNote.UserProperties("Parent Entity EntryID")
If (parentEntityEntryID Is Nothing) Then
Set parentEntityEntryID = _
newBusinessNote.UserProperties.Add("Parent Entity EntryID", _
olText, False, False)
End If
parentEntityEntryID.Value = parentEntryID

' Linking cont'd
Dim parentEntryIDs As Outlook.UserProperty
Set parentEntryIDs = newBusi

adding toobar item for business note creation

by Ed Marmon » Sat, 17 Feb 2007 14:59:45 GMT

There we go... now it worked.. thanks.

"Clinton Ford [MSFT]" < XXXX@XXXXX.COM > wrote




adding toobar item for business note creation

by Ed Marmon » Sat, 24 Feb 2007 04:22:28 GMT

PS- is there a way for me to back this up in case I need to later
reinstall office? on that same note- what's the way to back up email
account settings in outlook for the same reason? I tried the registry
route and it screwed things up ( i.e. wouldnt send and receive )... I
know the 2nd question here is n outlook question, but humor me if you
have 30 seconds.... Thanks for the help, makes BCM much more usable for
Act! refugees...


adding toobar item for business note creation

by Qm9iIFptdWRh » Sat, 24 Feb 2007 12:59:03 GMT

Wow, what an incredibly helpful post! I've tried adapting your work to create
a phone log macro, but I just can't seem to get it to work. I replaced
IPM.Activity.BCM.BusinessNote with IPM.Activity.BCM.PhoneCall and every
instance of newBusinessNote with newPhoneCall to no avail. What needs to be
replaced to create a phone log macro? Thank you.


adding toobar item for business note creation

by Luther » Mon, 26 Feb 2007 02:12:51 GMT

On Feb 23, 8:59 pm, Bob Zmuda < XXXX@XXXXX.COM >


Try IPM.Activity.BCM.PhoneLog.

Just a guess...



adding toobar item for business note creation

by Mukesh Agarwal [MSFT] » Tue, 27 Feb 2007 02:28:01 GMT

I don't think you can backup the toolbar button. You will have to create
that again. You can backup the code. Goto Tools->Macro->VB Editor. On the
editor, open the code. File->Export will export in .cls file. You can import
this file later. If you have lot of code, look for VBAProject.otm file
somewhere on your harddrive. Save this file. You can restore at the same
location later.
--
Mukesh Agarwal [MSFT]
Visit team blog at http://blogs.msdn.com/bcm

This posting is provided "AS IS" with no warranties, and confers no rights





adding toobar item for business note creation

by Qm9iIFptdWRh » Fri, 02 Mar 2007 05:22:34 GMT

I'll try your suggestion out tonight. I don't think it'll work, however,
because Microsoft's documentation lists the function as
IPM.Activity.BCM.PhoneCall, not IPM.Activity.BCM.PhoneLog.






Similar Threads

1. Is there a way to add a checkbox to toobar to save sent items

I have Options -> Save sent messages option checked by default and I do not 
want to save some of the sent messages. Instead of having to click Options 
and unchecking the checkbox, is there a way to add that option to the toolbar?

Thanks
JP

2. Copy Note Items in bulk as individual note items - Microsoft Office Outlook

3. Add notes to Business Card view

I use MSOutlook 2007 with Vista.  In contacts I want to add comments in 
"Notes" to be able to see on the multiple contacts page, just as addresses, 
emails, etc. are viewed.

4. Operation Failed or Operation aborted error messages when trying to add business note

5. Add an Outlook Toolbar Button to Create a Business Note

6. OneNote Notes about Outlook Items Add-in disabled - can't enable

7. Add notes, reminders, info to Outlook items

8. Outlook notes and business notes to stay on top - Microsoft Office Outlook