Linking tasks to Contacts

G

Guest

Okay, I get it now. So the BCM link is working, but the native Outlook
Contacts link that we are trying to create with the vba is not working. Do
you have any other procedures in your ThisOutlookSession? Did you close down
Outlook and restart after inserting the code? Is there anything peculiar
about your Outlook or BCM installation?

Regards.....Bill Kratz
 
L

Lon Orenstein

Yes, you're correct on all those statements. I've not only closed Outlook
but also rebooted.

There are some other addins (our pinpointtools applications) in the Trust
Center but none of those use VBA code.

Could there be some problem with the code I copied? I saw the other posts
about this newsgroup inserting a CRLF and splitting the line -- I fixed that
and got it to save/compile correctly, but maybe there's something else off.
Here's my code, copied from my ThisOutlookSession. This is the line that I
had to fix:
*** If Not objItem.UserProperties("TemporaryParentEntryId") Is Nothing
Then ***


Option Explicit
Private WithEvents olInspectors As Outlook.Inspectors

Private Sub Application_Startup()
Dim olApp As New Outlook.Application
Set olInspectors = olApp.Inspectors
End Sub

Private Sub olInspectors_NewInspector(ByVal pInspector As Outlook.Inspector)
Dim olApp As Outlook.Application
Dim objNS As Outlook.NameSpace
Dim objItem As Object
Dim strID As String
Dim bcmContact As Outlook.ContactItem

Set olApp = CreateObject("Outlook.Application")
Set objNS = olApp.GetNamespace("MAPI")
Set objItem = pInspector.CurrentItem

If objItem.Class = olTask Or olAppointment Then
If Not objItem.UserProperties("TemporaryParentEntryId") Is Nothing
Then
strID = objItem.UserProperties("TemporaryParentEntryId")
Set bcmContact = objNS.GetItemFromID(strID)
objItem.Links.Add bcmContact
End If
End If

Set bcmContact = Nothing
Set objItem = Nothing
Set objNS = Nothing
Set olApp = Nothing
End Sub

Private Sub Application_Quit()
Set olInspectors = Nothing
End Sub

Thanks for all your help on this. The BCM Community is thrilled to see you
here and as soon as we get this working, I'll ask you to expand it to show
the Phone Number of that Business Contact in the views. That will satisfy
another 200 people here.

Take care,
Lon

___________________________________________________________
Lon Orenstein
pinpointtools, llc
(e-mail address removed)
Author of Outlook 2007 Business Contact Manager For Dummies
Author of the eBook: Moving from ACT! to Business Contact Manager
800.238.0560 x6104 Toll Free (U.S. only) +1 214.905.0401 x6104
www.pinpointtools.com
 
G

Guest

Lon -- The code looks fine after the correction you made. Where is your
macro security set (Tools | Macro | Security)?

Regards.....Bill Kratz
 
M

mrtimpeterson via OfficeKB.com

Satifying more people here is what it's all about.

-THP



Lon said:
Yes, you're correct on all those statements. I've not only closed Outlook
but also rebooted.

There are some other addins (our pinpointtools applications) in the Trust
Center but none of those use VBA code.

Could there be some problem with the code I copied? I saw the other posts
about this newsgroup inserting a CRLF and splitting the line -- I fixed that
and got it to save/compile correctly, but maybe there's something else off.
Here's my code, copied from my ThisOutlookSession. This is the line that I
had to fix:
*** If Not objItem.UserProperties("TemporaryParentEntryId") Is Nothing
Then ***

Option Explicit
Private WithEvents olInspectors As Outlook.Inspectors

Private Sub Application_Startup()
Dim olApp As New Outlook.Application
Set olInspectors = olApp.Inspectors
End Sub

Private Sub olInspectors_NewInspector(ByVal pInspector As Outlook.Inspector)
Dim olApp As Outlook.Application
Dim objNS As Outlook.NameSpace
Dim objItem As Object
Dim strID As String
Dim bcmContact As Outlook.ContactItem

Set olApp = CreateObject("Outlook.Application")
Set objNS = olApp.GetNamespace("MAPI")
Set objItem = pInspector.CurrentItem

If objItem.Class = olTask Or olAppointment Then
If Not objItem.UserProperties("TemporaryParentEntryId") Is Nothing
Then
strID = objItem.UserProperties("TemporaryParentEntryId")
Set bcmContact = objNS.GetItemFromID(strID)
objItem.Links.Add bcmContact
End If
End If

Set bcmContact = Nothing
Set objItem = Nothing
Set objNS = Nothing
Set olApp = Nothing
End Sub

Private Sub Application_Quit()
Set olInspectors = Nothing
End Sub

Thanks for all your help on this. The BCM Community is thrilled to see you
here and as soon as we get this working, I'll ask you to expand it to show
the Phone Number of that Business Contact in the views. That will satisfy
another 200 people here.

Take care,
Lon

___________________________________________________________
Lon Orenstein
pinpointtools, llc
(e-mail address removed)
Author of Outlook 2007 Business Contact Manager For Dummies
Author of the eBook: Moving from ACT! to Business Contact Manager
800.238.0560 x6104 Toll Free (U.S. only) +1 214.905.0401 x6104
www.pinpointtools.com
Okay, I get it now. So the BCM link is working, but the native Outlook
Contacts link that we are trying to create with the vba is not working.
[quoted text clipped - 121 lines]
 
L

Lon Orenstein

It's set to "Warnings for signed macros; all unsigned macros are disabled"

Thanks,
Lon

___________________________________________________________
Lon Orenstein
pinpointtools, llc
(e-mail address removed)
Author of Outlook 2007 Business Contact Manager For Dummies
Author of the eBook: Moving from ACT! to Business Contact Manager
800.238.0560 x6104 Toll Free (U.S. only) +1 214.905.0401 x6104
www.pinpointtools.com
 
G

Guest

Okay, that's likely the glitch. Set it for "No Security" (I know, I know, it
says it's not recommended -- we'll deal with that later). Close and restart
Outlook, and let's try it again.

Regards.....Bill Kratz
 
L

Lon Orenstein

Yep, after I reset it to No Security, and then fought off all those locusts
and dodged the lightning bolts, it worked just fine. I appreciate your
support and contribution!

Now, about displaying the contact's phone number in the view...

Take care,
Lon

___________________________________________________________
Lon Orenstein
pinpointtools, llc
(e-mail address removed)
Author of Outlook 2007 Business Contact Manager For Dummies
Author of the eBook: Moving from ACT! to Business Contact Manager
800.238.0560 x6104 Toll Free (U.S. only) +1 214.905.0401 x6104
www.pinpointtools.com
 
G

Guest

Okay Lon, that's good news.

Now about that phone number display. I'll need you to explain just a bit
further. The primary purpose of this code was to create a link "back" to a
Business Contact or Account from a Task or Appointment created within BCM.
The idea is that when you are looking at your list of Tasks or Appointments
in your default pst, you may have any number of them that originated in BCM.
If you open one, and cannot easily navigate back to the Contact or Account
that is related, it can be pretty hard to know what to do with the open Item.
With the links created by this code, you can open a native Task or
Appointment, and then via the Contacts link you can quickly open the Business
Contact or Account to see what the heck is going on with that person(s).
Once you have opened that Contact or Account form, you have their phone
number displayed. So I'm not quite sure where and how you are suggesting
that we display the phone number. Let me know and maybe we'll go for it.

Regards.....Bill Kratz
 
L

Lon Orenstein

Bill:

The request has been made multiple times in this group for a function
similar to what people are used to in ACT (and other contact managers). In
their task list, they could see not only the subject of the task, but who it
was scheduled with (linked to, which you just fixed), and their phone number
(which we're all hoping you'll do next!). That way, a person can just look
at the task list, see the task (like make a follow up call to a prospect),
see who it applies to, and dial their number without ever leaving that one
screen.

So, that's why the request for the phone number too...

Thanks,
Lon

___________________________________________________________
Lon Orenstein
pinpointtools, llc
(e-mail address removed)
Author of Outlook 2007 Business Contact Manager For Dummies
Author of the eBook: Moving from ACT! to Business Contact Manager
800.238.0560 x6104 Toll Free (U.S. only) +1 214.905.0401 x6104
www.pinpointtools.com
 
G

Guest

Where is the "THISOUTLOOKSESSION" ???

Eric

I've whipped up a little vba that I think solves the majority (see the
caveat below) of the Task and Appointment linking complaints in BCM.
For convenience I'll just call this BCM Nexus (I like to name my bits
of vba for easy reference). When creating a new Task or Appointment
from a BCM Contact or Account record, BCM Nexus will automatically
insert the link back to the Contact or Account in the Contacts field
of the created Task or Apppointment. So when you open the Task or
Appointment from your default Tasks or Calendar folder, you can
navigate back to the BCM record (and associated History) by double-
clicking on the link in the Contacts field.

Here's what to do -- first, if you're running Outlook 2007, you may
need to "re-reveal" the Contacts field on your Task and Appointment
forms. Go to Tools | Options | Preferences Tab | Contact Options
Button | Check "Show Contact Linking on all Forms". Now insert the
following vba code in your ThisOutlookSession:

Option Explicit
Private WithEvents olInspectors As Outlook.Inspectors
-----------------------------------------------------------------------
Private Sub Application_Startup()
Dim olApp As New Outlook.Application
Set olInspectors = olApp.Inspectors
End Sub

Private Sub olInspectors_NewInspector(ByVal pInspector As
Outlook.Inspector)
Dim olApp As Outlook.Application
Dim objNS As Outlook.NameSpace
Dim objItem As Object
Dim strID As String
Dim bcmContact As Outlook.ContactItem

Set olApp = CreateObject("Outlook.Application")
Set objNS = olApp.GetNamespace("MAPI")
Set objItem = pInspector.CurrentItem

If objItem.Class = olTask Or olAppointment Then
If Not objItem.UserProperties("TemporaryParentEntryId") Is
Nothing Then
strID = objItem.UserProperties("TemporaryParentEntryId")
Set bcmContact = objNS.GetItemFromID(strID)
objItem.Links.Add bcmContact
End If
End If

Set bcmContact = Nothing
Set objItem = Nothing
Set objNS = Nothing
Set olApp = Nothing
End Sub
---------------------------------------------------------------------
Private Sub Application_Quit()
Set olInspectors = Nothing
End Sub

Close and restart Outlook. That's it; you're done. Tasks and
Appointments created from BCM will include a native Outlook link back
to the BCM Contact.

Caveats and Disclaimers: I've only tested this with Outlook 2007.
Hopefully someone else will be so kind as to test it with 2003. This
only creates the link when initiated from the BCM side of things. If
you create a Task or Appointment from the default folders and then
link it to a BCM Contact/Account with the Ribbon button, the code
above doesn't come into play. You will still have to manually link to
the BCM Contact. For my own workflow this isn't a problem at all,
since essentially all of the time I would create the Task or
Appointment from within the BCM interface.

Hope this helps to make BCM a bit more useful.

Regards.....Bill Kratz
 
E

emilberger

It creates a task like for example "pick up at office" but does not attach
the contact so therefore you don't knwo who to pick up
 
E

emilberger

I am also so amaized. A little tweaking from my taks to-do-bar and now I see
a taks that finally means somehting.

John Doe
ACME company
Pick up at airport
256-555-1212
Notes: he works for the cyote


Thank-you Bill
 
R

RC

There are a whole list of shortcomings BCM has. It is clear it was designed
by someone who very little need for contacts and contact management.

In any case, It seems that what William Kratz posted as a solution is great.
The only issue I have is I don't know how to activate it.

WK says we shoudl insert his vba code into "ThisOutlookSession". How do we
do this? Sorry I'm just a user not a programmer.

Thanks
rodolfo
 
A

Andy Carr

I have got this to work when the task against a contact however I would like
this to also work when creating a new task within an opportunity (that is
associated with a contact). can the code be modified to do this?

Thanks
 

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