S
SLP
Hi, After reading lots of posts, I copied the code as follows but when I
import it goes to the default form and the "Billing Information" does not get
placed in User1. I keep starring at the code and don't know what to do. Any
help would be appreciated. Thanks.
Sub ConvertFields()
Dim objApp As Application
Dim objNS As NameSpace
Dim objFolder As MAPIFolder
Dim objItems As Items
Dim objItem As Object
Set objApp = CreateObject("Outlook.Application")
Set objNS = objApp.GetNamespace("MAPI")
Set objFolder = objNS.PickFolder
If Not objFolder Is Nothing Then
Set objItems = objFolder.Items
For Each objItem In objItems
' make sure you have a Contact item
If objItem.Class = olContact Then
' convert to your published custom form
objItem.MessageClass = "IPM.Contact.ContactsNewTwo"
' copy data to your custom fields
objItem.UserProperties("Billing Information") = objItem.User1
objItem.UserProperties("Custom2") = objItem.User2
objItem.UserProperties("Custom3") = objItem.User3
objItem.UserProperties("Custom4") = objItem.User4
objItem.User1 = ""
objItem.User2 = ""
objItem.User3 = ""
objItem.User4 = ""
objItem.Save
End If
Next
End If
Set objItems = Nothing
Set objItem = Nothing
Set objFolder = Nothing
Set objNS = Nothing
Set objApp = Nothing
End Sub
import it goes to the default form and the "Billing Information" does not get
placed in User1. I keep starring at the code and don't know what to do. Any
help would be appreciated. Thanks.
Sub ConvertFields()
Dim objApp As Application
Dim objNS As NameSpace
Dim objFolder As MAPIFolder
Dim objItems As Items
Dim objItem As Object
Set objApp = CreateObject("Outlook.Application")
Set objNS = objApp.GetNamespace("MAPI")
Set objFolder = objNS.PickFolder
If Not objFolder Is Nothing Then
Set objItems = objFolder.Items
For Each objItem In objItems
' make sure you have a Contact item
If objItem.Class = olContact Then
' convert to your published custom form
objItem.MessageClass = "IPM.Contact.ContactsNewTwo"
' copy data to your custom fields
objItem.UserProperties("Billing Information") = objItem.User1
objItem.UserProperties("Custom2") = objItem.User2
objItem.UserProperties("Custom3") = objItem.User3
objItem.UserProperties("Custom4") = objItem.User4
objItem.User1 = ""
objItem.User2 = ""
objItem.User3 = ""
objItem.User4 = ""
objItem.Save
End If
Next
End If
Set objItems = Nothing
Set objItem = Nothing
Set objFolder = Nothing
Set objNS = Nothing
Set objApp = Nothing
End Sub