![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
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 |
Ads |
#2
|
|||
|
|||
![]()
You're usually better off posting programming questions in a programming
group. Did you register Redemption? Is it in your VBA project references? -- 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 r kimball wrote in message ... 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Outlook Redemption - HELP | Rob | Outlook and VBA | 7 | June 23rd 07 11:38 PM |
New Version of Redemption - Jan 7, 2007 | Tadwick | Outlook and VBA | 0 | January 12th 07 06:42 PM |
How to set CC @ Outlook Redemption | Luk | Outlook and VBA | 8 | November 9th 06 06:20 PM |
How to set CC @ Outlook Redemption | Luk | Outlook - General Queries | 2 | November 8th 06 02:17 PM |
Outlook Redemption | fgibbcollins | Outlook and VBA | 2 | March 16th 06 06:03 PM |