Import into Custom form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm using Office 2003. I created a custom contact form in Outlook and stored
it in a folder under Contacts. When I try to import my contacts from Access
and get to the part of the dialouge where I'm mapping, the fields on the
right are not from my custom form, they are from the default Outlook contacts
form. Does anyone know how I can import my table into my custom form?
 
Outlook does not support importing custom forms.

--
Milly Staples [MVP - Outlook]

Post all replies to the group to keep the discussion intact. All
unsolicited mail sent to my personal account will be deleted without
reading.

After furious head scratching, Kathleane asked:

| I'm using Office 2003. I created a custom contact form in Outlook and
| stored it in a folder under Contacts. When I try to import my
| contacts from Access and get to the part of the dialouge where I'm
| mapping, the fields on the right are not from my custom form, they
| are from the default Outlook contacts form. Does anyone know how I
| can import my table into my custom form?
 
I followed the instruction on the MS site to write a VBS script to solve this
problem but it didn't work. I'm sure there's some little thing that I haven't
done correctly. When I run the script nothing happens. No error mssg, just
nothing happens except that a new Mail message opens. BTW the custom form
that I'm trying to work with is a Contact form.

!'ve named my custom form
SU Sitters

It occurred to me that the problem could be that there is a space in my form
name. Anyway here is the VBS script that I'm trying to run:

Sub Item Open ' Change the following line to your new Message Class NewMC =
"IPM.Contact.SU Sitters" Set CurFolder =
Application.ActiveExplorer.CurrentFolder Set AlItems = CurFolder.Items
NumItems = CurFolder.Items.Count ' Loop through all of the items in the folder
For I = 1 to NumItems Set CurItem = AllItems.Item(I) ' Test to see if the
Message Class needs to be changed If CurItem.MessageClass <> NewMC Then '
Change the Message Class CurItem.MessageClass = NewMC ' Save the changed item
CurItem.Save End If Next MsgBox "Done." End Sub

Does anyone see where I could have gone wrong with this script?

One more detail - the custom form is stored in a different directory than
the VBS script. I tried to publish the VBS script to the same folder but it
saves instead to the MS Templates folder.
 
If the form isn't published, it can't run your script. I'd suggest that you use a VBA macro rather than code behind a form, so that you have full use of the debgger.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Would I use the same script that I received from the MS help site but copy it
into a macro?

Could naming my custom form using two words with a space between be
problematic?
 
Would I use the same script that I received from the MS help site but copy it
into a macro?

Is naming my custom form using two words with a space between problematic?
 
Would I use the same script that I received from the MS help site but copy it
into a macro?

Yes, that should work.
Could naming my custom form using two words with a space between be
problematic?

No, because the form message class is a string literal and, therefore, must always be enclosed in quotation marks, regardless of whether it has a space in it.
 
I ran into too many problems trying to use this script as a Macro. But I've
been working on the VBS script and have corrected all errors except this last
one which I can't figure out. When I run the script below I get the following
error mssg:
Expected End of Statement
Line No: 5

Here's the script:
Sub ImportToCustom()
' Change the following line to your new Message Class
NewMC = "IPM.Contact.SU Sitters"

Set CurFolder = Application.ActiveExplorer.CurrentFolder Set AlItems =
CurFolder.Items
NumItems = CurFolder.Items.Count

' Loop through all of the items in the folder
For I = 1 to NumItems Set CurItem = AllItems.Item(I)

' Test to see if the Message Class needs to be changed
If CurItem.MessageClass <> NewMC
Then Change the Message Class CurItem.MessageClass = NewMC

' Save the changed item
CurItem.Save End If Next MsgBox "Done."
End Sub
 
Looks like lines 5 and 6 have been run together. Line 6 should be with Set AllItems = CurFolder.Items. Looks like a lot of other statements are also run together.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
I found an answer! The Omsgclas.doc that MS published runs a macro that takes
care of converting previously imported contacts to the new default contact
form. It took a bit of working with as the instructions aren't very specific
but in the end it worked!

Thank you all for your help. I am especially glad to have been made aware of
the outlookcode site. I'll definately be using that and probably buying the
book.
 
Glad to hear you got it working -- and probably learned some useful things about OUtlook macros in the process.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
I did learn a lot. It's fun stuff. Frustrating sometimes, but mostly fun.
Thank you for your encouragement.
 
Back
Top