G
Greg Martin
I have the following vbscript code to create a contact in a Public Folder.
Code was working fine until we upgraded the box it was running on to Win2k.
Hasn't run since. I'm not blaming Win2k, just note-ing that the platform
did change. Box has Outlook 2000 pre-SR1 installed and CDO.DLL version
5.5.2653.12.
The error is reported on the line with Items.Add (olContactItem) and says:
"Microsoft Outlook: Could not complete the operation. One or more parameter
values are not valid"
I have verified the olFoldobj is set correctly by echoing the .name property
and got the desired results
Thanks
\\Greg Martin
(e-mail address removed)
Sub AddContact(olFoldobj,Fullname, CompanyName, EMailAddress)
'********************************************
' Adds a contact to the folder object referred to in olFoldObj
'Create and Open a new contact.
'olFoldobj must be an outlook object pointing to the folder
Dim olItem 'As Outlook.ContactItem
Const olContactItem = 2
Set olItem = olFoldobj.Items.Add(olContactItem) '<-------------- this
line generates error
' Set Contact information...
With olItem
.Fullname = Fullname & " (" & CompanyName & ")"
.Email1Address = EMailAddress
.Email1DisplayName = fullname & " (" & CompanyName & ")"
.FileAs = fullname & " (" & CompanyName & ")"
.Email1AddressType = "SMTP"
End With
' Save Contact...
olItem.Save
End sub
Code was working fine until we upgraded the box it was running on to Win2k.
Hasn't run since. I'm not blaming Win2k, just note-ing that the platform
did change. Box has Outlook 2000 pre-SR1 installed and CDO.DLL version
5.5.2653.12.
The error is reported on the line with Items.Add (olContactItem) and says:
"Microsoft Outlook: Could not complete the operation. One or more parameter
values are not valid"
I have verified the olFoldobj is set correctly by echoing the .name property
and got the desired results
Thanks
\\Greg Martin
(e-mail address removed)
Sub AddContact(olFoldobj,Fullname, CompanyName, EMailAddress)
'********************************************
' Adds a contact to the folder object referred to in olFoldObj
'Create and Open a new contact.
'olFoldobj must be an outlook object pointing to the folder
Dim olItem 'As Outlook.ContactItem
Const olContactItem = 2
Set olItem = olFoldobj.Items.Add(olContactItem) '<-------------- this
line generates error
' Set Contact information...
With olItem
.Fullname = Fullname & " (" & CompanyName & ")"
.Email1Address = EMailAddress
.Email1DisplayName = fullname & " (" & CompanyName & ")"
.FileAs = fullname & " (" & CompanyName & ")"
.Email1AddressType = "SMTP"
End With
' Save Contact...
olItem.Save
End sub