Re: Mapping Custom Fields for a Contact Folder
From: Sue Mosher [MVP-Outlook] (suemvp_at_outlookcode.com)
Date: 07/31/04
- Previous message: Betty: "Re: Mapping Custom Fields for a Contact Folder"
- In reply to: Betty: "Re: Mapping Custom Fields for a Contact Folder"
- Next in thread: Betty: "Re: Mapping Custom Fields for a Contact Folder"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 31 Jul 2004 15:47:01 -0400
The code statement in my last post is an example of pulling information from
a built-in Outlook field into a custom property.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
"Betty" <anonymous@discussions.microsoft.com> wrote in message
news:7ea301c4772f$75554fb0$a501280a@phx.gbl...
> 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 spread*** 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
> >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?
> >
> >"Betty" <anonymous@discussions.microsoft.com> wrote in
> message
> >news:28d1301c46534$3dba49a0$a601280a@phx.gbl...
> >> 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
> >> >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.
> >> >
> >> >--
> >> >Sue Mosher, Outlook MVP
> >> >Author of
> >> > Microsoft Outlook Programming - Jumpstart for
> >> > Administrators, Power Users, and Developers
> >> > http://www.outlookcode.com/jumpstart.aspx
> >> >
> >> >
> >> ><anonymous@discussions.microsoft.com> wrote in message
> >> >news:22b7c01c45d50$7ad283c0$a001280a@phx.gbl...
> >> >> 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!
> >> >
> >> >
> >> >.
> >> >
> >
> >
> >.
> >
- Previous message: Betty: "Re: Mapping Custom Fields for a Contact Folder"
- In reply to: Betty: "Re: Mapping Custom Fields for a Contact Folder"
- Next in thread: Betty: "Re: Mapping Custom Fields for a Contact Folder"
- Messages sorted by: [ date ] [ thread ]