K
Kage_
Hello everyone
I have a custom form that I have designed to auto fill custome
information. I found a code example at Windows IT Pro and it work
great, but for some reason the code has developed a bug
The user enters a contact into the field and then clicks a button o
saves the form the code tries to match the contact and auto fil
several fields including the phone number, pager number, cell numbe
etc. The problem occures if the user enters a contact that is not i
the contact database the script will fault. I have tried to find th
orginal code and article on WITPro, but I have been unable to. Als
the orginal article was written by Sue Mosher
Here is the code as I am running it when the user clicks the contac
info button
'This section will excecute upon click of th
'Customer Information butto
Sub CustomerInfoButton_Click(
Dim colLink
Dim objLin
Dim objContac
Set colLinks = Item.Link
If colLinks.Count > 0 The
Set objLink = colLinks.Item(1
Set objContact = objLink.Ite
If Not objContact Is Nothing The
Item.UserProperties("CompanyField") =
objContact.CompanyNam
Item.UserProperties("SiteField") =
objContact.Departmen
Item.UserProperties("PhoneNumberField"
=
objContact.BusinessTelephoneNumbe
Item.UserProperties("PagerNumberField"
=
objContact.PagerNumbe
Item.UserProperties("CellPhoneField")
objContact.MobileTelephoneNumbe
Item.UserProperties("CustomerNotes") =
objContact.Bod
End I
End I
Set objContact = Nothin
Set objLink = Nothin
Set colLinks = Nothin
End Su
According to the debuger it's faulting at "Set objContact
objLink.Item". I know very little about VB script so I have not bee
able to figure out the problem. I'm hopping someone will be able t
see where the problem is
I am using Outlook version 2003 SP1 Build (11.6359.6360)
Thanks
Mik
I have a custom form that I have designed to auto fill custome
information. I found a code example at Windows IT Pro and it work
great, but for some reason the code has developed a bug
The user enters a contact into the field and then clicks a button o
saves the form the code tries to match the contact and auto fil
several fields including the phone number, pager number, cell numbe
etc. The problem occures if the user enters a contact that is not i
the contact database the script will fault. I have tried to find th
orginal code and article on WITPro, but I have been unable to. Als
the orginal article was written by Sue Mosher
Here is the code as I am running it when the user clicks the contac
info button
'This section will excecute upon click of th
'Customer Information butto
Sub CustomerInfoButton_Click(
Dim colLink
Dim objLin
Dim objContac
Set colLinks = Item.Link
If colLinks.Count > 0 The
Set objLink = colLinks.Item(1
Set objContact = objLink.Ite
If Not objContact Is Nothing The
Item.UserProperties("CompanyField") =
objContact.CompanyNam
Item.UserProperties("SiteField") =
objContact.Departmen
Item.UserProperties("PhoneNumberField"
=
objContact.BusinessTelephoneNumbe
Item.UserProperties("PagerNumberField"
=
objContact.PagerNumbe
Item.UserProperties("CellPhoneField")
objContact.MobileTelephoneNumbe
Item.UserProperties("CustomerNotes") =
objContact.Bod
End I
End I
Set objContact = Nothin
Set objLink = Nothin
Set colLinks = Nothin
End Su
According to the debuger it's faulting at "Set objContact
objLink.Item". I know very little about VB script so I have not bee
able to figure out the problem. I'm hopping someone will be able t
see where the problem is
I am using Outlook version 2003 SP1 Build (11.6359.6360)
Thanks
Mik