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 / Programming Forms / July 2004

Tip: Looking for answers? Try searching our database.

Mapping Custom Fields for a Contact Folder

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
- 28 Jun 2004 21:42 GMT
I am trying to import a Contact file from Excel into a
Contact folder in Outlook.  The field names that are used
in first row of the excel file for the contacts don't
match the contact field names that are available in the
Import Wizard Custom Field Mapping area.  

I built and published custom form with the matching field
names and have tried to import using this form.

What happens when I import the contacts is that I continue
to only have access to the standard Contacts forms and
when I choose the custom form that I created, It comes up
very beautifully....but empty of data.

I have tried this in Private folders and public folders.

I sat through an hour long recorded webinar on Outlook
hoping for insight and have read these posts looking for
more information.

Help!
Sue Mosher [MVP-Outlook] - 28 Jun 2004 22:06 GMT
Outlook doesn't support importing to a custom form. Either map to built-in
fields in the Import and Export Wizard or write custom code to perform the
import to custom fields or use a third-party application. See
http://www.outlookcode.com/d/customimport.htm.

Signature

Sue Mosher, Outlook MVP
Author of
    Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx

> I am trying to import a Contact file from Excel into a
> Contact folder in Outlook.  The field names that are used
[quoted text clipped - 17 lines]
>
> Help!
Betty - 08 Jul 2004 22:40 GMT
Hi Sue,

I went to your website and "captured" the VBS Script.  I
have imported the information into fields where I
have "Parked" it so I can import this information into my
User Defined Fields.

Now, I know this may seem like a no-brainer but how do I
use the script?

I have gone into it the generic script and placed the
field names from the "parked" form into the areas that I
guessed are designated for that and have also inserted the
field names from my Custom form into where I imagine they
belong.  I am going to insert this edited VBS Script here
if space allows.
I have tried to run the script three different ways:
From the form that I parked the info in
From the Custom form that I created
As a Macro created in Outlook outside of any forms
whatsoever.

I've probably done something silly like reverse the field
names or something but I'm at my wit's end and this is the
last thing standing between me and completeing a project
that I should have had completed a while back.

Can you please help me?

Here is the edited code:
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.Custom"
       ' copy data to your custom fields
       objItem.UserProperties("Rep") = objItem.Manager 's
Name
       objItem.UserProperties("Account") = objItem.Account
       objItem.UserProperties("Mailing Address") =
objItem.BusinessStreet
       objItem.UserProperties("Ship To") =
objItem.OtherStreet
       objItem.UserProperties("City") =
objItem.BusinessCity
       objItem.UserProperties("Zip") =
objItem.BusinessPostalCode
       objItem.UserProperties("Ship To City") =
objItem.OtherCity
       objItem.UserProperties("Ship To Zip") =
objItem.OtherPostalCode
       objItem.UserProperties("County") =
objItem.OfficeLocation
       objItem.UserProperties("Principle") = objItem.Name
       objItem.UserProperties("Principle Title") =
objItem.JobTitle
       objItem.UserProperties("Second Contact") =
objItem.Assistant 's Name
       objItem.UserProperties("Third Contact") =
objItem.User1
       objItem.UserProperties("Principle Phone") =
objItem.BusinessPhone
       objItem.UserProperties("Principle Cell") =
objItem.MobilePhone
       objItem.UserProperties("Principle Pager") =
objItem.Pager
       objItem.UserProperties("Principle Home Phone") =
objItem.HomePhone
       objItem.UserProperties("Third Contact Cell") =
objItem.OtherPhone
       objItem.UserProperties("Principle Fax") =
objItem.BusinessFax
       objItem.UserProperties("Second Contact Phone") =
objItem.BusinessFax
       objItem.UserProperties("Second Contact Cell") =
objItem.CarPhone
       objItem.UserProperties("Second Contact Home") =
objItem.HomePhoneFax
       objItem.Manager 's Name = ""
       objItem.Account = ""
       objItem.Mailing Address = ""
       objItem.ShipTo = ""
       objItem.City = ""
       objItem.Zip = ""
       objItem.ShipTo City = ""
       objItem.ShipTo Zip = ""
       objItem.County = ""
       objItem.Principle = ""
       objItem.Principle Title = ""
       objItem.Second Contact = ""
       objItem.Third Contact = ""
       objItem.Principle Phone = ""
       objItem.Principle Cell = ""
       objItem.Principle Pager = ""
       objItem.Principle HomePhone = ""
       objItem.Third ContactCell = ""
       objItem.Principle Fax = ""
       objItem.Second ContactPhone = ""
       objItem.Second ContactHome = ""
       objItem.Save
     End If
   Next
 End If

 Set objItems = Nothing
 Set objItem = Nothing
 Set objFolder = Nothing
 Set objNS = Nothing
 Set objApp = Nothing
End Sub

Private Sub Application_ItemSend(ByVal Item As Object,
Cancel As Boolean)

End Sub

>-----Original Message-----
>Outlook doesn't support importing to a custom form. Either map to built-in
[quoted text clipped - 25 lines]
>
>.
Sue Mosher [MVP-Outlook] - 19 Jul 2004 15:47 GMT
In each statement, the target field needs to be on the left side of the
statement, the source data on the right. So statements like this copy the
data from the Manager field into the Rep field:

   objItem.UserProperties("Rep") = objItem.Manager

What happens when you try to step through the code in VBA?
--
Sue Mosher, Outlook MVP
Author of
    Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx

> Hi Sue,
>
[quoted text clipped - 160 lines]
> >
> >.
Betty - 31 Jul 2004 19:51 GMT
Awesome!  Thanks for the reply!  I am now trying to apply
this new concept.  As I understand it, the code I am
trying to edit has two purposes:  1 to actually pull the
info from the excel spreadsheet 2 to pull the info from
Outlook fields into my user defined field names.
Is that correct?  If so, which portion of the code is used
for pulling the info from Outlook field names into user
defined fields?  (I have already "parked" the data in
Outlook fields by Custom mapping and now just need to pull
it from there into my fields.  Will let you know how this
works out today.

Thanks again!
>-----Original Message-----
>In each statement, the target field needs to be on the left side of the
[quoted text clipped - 177 lines]
>
>.
Sue Mosher [MVP-Outlook] - 31 Jul 2004 20:47 GMT
The code statement in my last post is an example of pulling information from
a built-in Outlook field into a custom property.

Signature

Sue Mosher, Outlook MVP
Author of
    Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx

> Awesome!  Thanks for the reply!  I am now trying to apply
> this new concept.  As I understand it, the code I am
[quoted text clipped - 206 lines]
> >
> >.
Betty - 31 Jul 2004 19:59 GMT
I get this response "Object doesn't support this property
or method" in a pop up window and the script opens up. I
am looking at the Field names where i "parked' the data
and it doesn't seem to like field names that have spaces
and or apostrophes for instance my data for Rep
is "parked" in the Outlook field named: "Manager's Name"
Outlook's VPS doesn't seem to like that.

>-----Original Message-----
>In each statement, the target field needs to be on the left side of the
[quoted text clipped - 177 lines]
>
>.
Sue Mosher [MVP-Outlook] - 31 Jul 2004 20:48 GMT
Which statement triggers that message? In general, yes, you should stay away
from using apostrophes in property names, because it can be difficult to
distinguish an apostrophe from a quotation mark limiting a string.

Signature

Sue Mosher, Outlook MVP
Author of
    Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx

> I get this response "Object doesn't support this property
> or method" in a pop up window and the script opens up. I
[quoted text clipped - 3 lines]
> is "parked" in the Outlook field named: "Manager's Name"
> Outlook's VPS doesn't seem to like that.
 
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.