Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Contacts / August 2007

Tip: Looking for answers? Try searching our database.

redemption in outlook 2007

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
r kimball - 08 Aug 2007 11:16 GMT
I had a macro that worked fine in Outlook 2003 under windows 2K; on a new machine running windows xp sp2 and outlook 2007, it doesn't work. This macro copied info from a selected contact to the clipboard with just one click: very useful! Error message is : "Compile error: Can't find project or library." Offending line is: Set mySafeContact = CreateObject("Redemption.SafeContactItem") Can anyone help? I have installed Redemption. Here is the relevant code.  Thanks in advance!!

Sub copy_contact_info()

Dim ol As New Outlook.Application
Dim sl As Outlook.Selection
Dim myExplorer As Outlook.Explorer
Dim strContactInfo As String
Dim MyData As New MSForms.dataObject
Dim mySafeItem As Object

Set myExplorer = ol.ActiveExplorer
Set sl = myExplorer.Selection

Set mySafeContact = CreateObject("Redemption.SafeContactItem")
Set mySafeContact.Item = sl.Item(1)

With mySafeContact

           
       strContactInfo = FormatEntryBreak(.FullName)
       If .BusinessAddressStreet <> "" Then
       strContactInfo = strContactInfo & FormatEntryBreak("Business:")
       strContactInfo = strContactInfo & FormatEntryBreak(.JobTitle)
       strContactInfo = strContactInfo & FormatEntryBreak(.CompanyName)
       strContactInfo = strContactInfo & FormatEntryBreak(.BusinessAddressStreet)
       strContactInfo = strContactInfo & FormatEntryComma(.BusinessAddressCity)
       strContactInfo = strContactInfo & " " & .BusinessAddressState
       strContactInfo = strContactInfo & "  " & .BusinessAddressPostalCode & vbCrLf
           If .BusinessAddressCountry <> "United States of America" Then
       strContactInfo = strContactInfo & FormatEntryBreak(.BusinessAddressCountry) & vbCrLf & vbCrLf
           End If
       strContactInfo = strContactInfo & vbCrLf
       End If
       If .HomeAddressStreet <> "" Then
       strContactInfo = strContactInfo & FormatEntryBreak("Home:")
       strContactInfo = strContactInfo & FormatEntryBreak(.HomeAddressStreet)
       strContactInfo = strContactInfo & FormatEntryComma(.HomeAddressCity)
       strContactInfo = strContactInfo & " " & .HomeAddressState
       strContactInfo = strContactInfo & "  " & .HomeAddressPostalCode & vbCrLf
           If .HomeAddressCountry <> "United States of America" Then
       strContactInfo = strContactInfo & FormatEntryBreak(.HomeAddressCountry) & vbCrLf
           End If
       strContactInfo = strContactInfo & vbCrLf
       End If
       If .OtherAddressStreet <> "" Then
       strContactInfo = strContactInfo & FormatEntryBreak("Other:")
       strContactInfo = strContactInfo & FormatEntryBreak(.OtherAddressStreet)
       strContactInfo = strContactInfo & FormatEntryComma(.OtherAddressCity)
       strContactInfo = strContactInfo & " " & .OtherAddressState
       strContactInfo = strContactInfo & "  " & .OtherAddressPostalCode & vbCrLf
           If .OtherAddressCountry <> "United States of America" Then
       strContactInfo = strContactInfo & FormatEntryBreak(.OtherAddressCountry) & vbCrLf
           End If
       strContactInfo = strContactInfo & vbCrLf
       End If
       
       
       
       If .HomeTelephoneNumber <> "" Then
           strContactInfo = strContactInfo & FormatEntryBreak("H: " & .HomeTelephoneNumber)
       End If
       
       If .BusinessTelephoneNumber <> "" Then
           strContactInfo = strContactInfo & FormatEntryBreak("O: " & .BusinessTelephoneNumber)
       End If
       
       If .BusinessFaxNumber <> "" Then
           strContactInfo = strContactInfo & FormatEntryBreak("F: " & .BusinessFaxNumber)
       End If
       
       If .MobileTelephoneNumber <> "" Then
           strContactInfo = strContactInfo & FormatEntryBreak("M: " & .MobileTelephoneNumber)
       End If
               
       If .Email1Address <> "" Then
           strContactInfo = strContactInfo & vbCrLf & FormatEntryBreak(.Email1Address)
       End If
   
       If .Email2Address <> "" Then
           strContactInfo = strContactInfo & vbCrLf & FormatEntryBreak(.Email2Address)
       End If
   
    End With
   
    MyData.SetText strContactInfo
    MyData.PutInClipboard
       

End Sub

EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com
Ken Slovak - [MVP - Outlook] - 08 Aug 2007 13:46 GMT
You're usually better off posting programming questions in a programming
group.

Did you register Redemption? Is it in your VBA project references?

Signature

Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm

>I had a macro that worked fine in Outlook 2003 under windows 2K; on a new
>machine running windows xp sp2 and outlook 2007, it doesn't work. This
[quoted text clipped - 109 lines]
> EggHeadCafe.com - .NET Developer Portal of Choice
> http://www.eggheadcafe.com
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.