write to custom fields in public Folder

Joined
Nov 14, 2005
Messages
2
Reaction score
0
Hi,
I am desining a form that creates new contacts in a public folder. So far everything is fine with outlook standard fields. In the public Folder I created a form for viewing, with some custom fields. How can i fill these fields ?
Below is my code, the field i want to fill with text is the Myvalue14 to TitleSurname (Custom field in View Form).

Please advise and thanks in advance.
Edwin

--- Code Below ---
Sub Validatebtn2_Click()

Dim MyPage

Dim mNameSpace

Dim PublicFolder

Dim AllPublicFolders

Dim MyPublicFolder

Dim myItem

Dim strMsg

Dim strPublicFolder

Const olAppointmentItem = 1

'Query the User for the Contact Info

strPublicFolder = "
Custom Contacts"

If Len(strPublicFolder) > 0 Then

' Create all necessary Outlook Objects

Set objOutlook = CreateObject("Outlook.application")

Set mNameSpace = objOutlook.GetNameSpace("MAPI")

Set PublicFolder = mNameSpace.Folders("Public Folders")

Set AllPublicFolders = PublicFolder.Folders("All Public Folders")

Set MyPublicFolder= AllPublicFolders.Folders(strPublicFolder)

Set MyValue1 = Item.Userproperties("bolCompanyContactName")

Set Myvalue2 = Item.Userproperties("bolCompanyPoBox")

Set Myvalue3 = Item.Userproperties("bolCompanyPostalCode")

Set Myvalue4 = Item.Userproperties("bolCompanyCity")

Set Myvalue5 = Item.Userproperties("bolCompanyCountry")

Set Myvalue6 = Item.Userproperties("bolVisitingStreet")

Set Myvalue7 = Item.Userproperties("bolVisitingPostalCode")

Set Myvalue8 = Item.Userproperties("bolVisitingCity")

Set Myvalue9 = Item.Userproperties("bolInfoTitle")

Set Myvalue10 = Item.Userproperties("bolInfoInitials")

Set Myvalue11 = Item.Userproperties("bolInfoFirstName")

Set Myvalue12 = Item.Userproperties("bolInfoInfix")

Set Myvalue13 = Item.Userproperties("bolInfoSurName")

Set Myvalue14 = Userproperties("bolInfoTitleSurName")

Set myItem = MyPublicFolder.Items.Add

With myItem

.Fullname = MyValue1

.BusinessAddressPostOfficeBox = Myvalue2

.BusinessAddressPostalCode = Myvalue3

.BusinessAddressCity = Myvalue4

.BusinessAddressCountry = Myvalue5

.OtherAddressStreet = Myvalue6

.OtherAddressPostalCode = Myvalue7

.OtherAddressCity = Myvalue8

.Title = Myvalue9

.Initials = Myvalue10

.FirstName = Myvalue11

.Suffix = Myvalue12

' .LastName = Myvalue13 --- automatically generated ----

.TitleSurName = Myvalue14

.Save

End With

End If

Set MyItem = Nothing

End Sub

 
Joined
Nov 14, 2005
Messages
2
Reaction score
0
Forgot to tell .....

The last line (TitleSurName = Myvalue14) is giving me an

Object doesn't support this property or method error ...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top