Accessing Custom Fields from Outlook form

Accessing Custom Fields from Outlook form

Post by Me » Fri, 31 Jul 1998 04:00:00



I am writing a VB application that uses Active Messaging to send a message.
My VB code that sends the message is as follows:

Private Sub cmdSend_Click()
   Dim oMessage As Message
   Dim oRecipient As Recipient
   Dim oField As Field

  Set oMessage = mSession.Outbox.Messages.Add
   With oMessage
      .Subject = "Test Message"
      .Type = "IPM.NOTE.MYMESSAGE"
      Set oField = .Fields.Add("Test", vbInteger, 5)
   End With
   MsgBox oField.Name & oField.Value
   Set oRecipient = oMessage.Recipients.Add
   With oRecipient
      .Name = "My User"
      .Type = mapiTo
      .Resolve
   End With
   oMessage.Send
end sub

The code in my outlook form is as follows:

Sub Item_Open()

  set mThisItem = Application.ActiveInspector.CurrentItem
  msgBox mThisItem.UserProperties.count ' This returns 0
  msgBox mThisItem.UserProperties.Item("Test").Value 'This returns an error

End Sub

The problem that I am having is accessing the "Test" field in my outlook
form. Can anyone give me an idea of what I am doing wrong here?

Thanks in advance,
-Vinny

 
 
 

Accessing Custom Fields from Outlook form

Post by Lambert Bruggema » Sun, 09 Aug 1998 04:00:00


First,

try to find out if the field is in the message:

    - Add a field to the view in Outlook called "Test" (without the quotes)
and of type integer (NOT NUMBER!)

Then, if it is in the view:
  - Try using Item instead of mThisItem in your form code. Item is a
built-in Outlook object referencing the message you just opened.

Hope this helps.


>I am writing a VB application that uses Active Messaging to send a message.
>My VB code that sends the message is as follows:

>Private Sub cmdSend_Click()
>   Dim oMessage As Message
>   Dim oRecipient As Recipient
>   Dim oField As Field

>  Set oMessage = mSession.Outbox.Messages.Add
>   With oMessage
>      .Subject = "Test Message"
>      .Type = "IPM.NOTE.MYMESSAGE"
>      Set oField = .Fields.Add("Test", vbInteger, 5)
>   End With
>   MsgBox oField.Name & oField.Value
>   Set oRecipient = oMessage.Recipients.Add
>   With oRecipient
>      .Name = "My User"
>      .Type = mapiTo
>      .Resolve
>   End With
>   oMessage.Send
>end sub

>The code in my outlook form is as follows:

>Sub Item_Open()

>  set mThisItem = Application.ActiveInspector.CurrentItem
>  msgBox mThisItem.UserProperties.count ' This returns 0
>  msgBox mThisItem.UserProperties.Item("Test").Value 'This returns an error

>End Sub

>The problem that I am having is accessing the "Test" field in my outlook
>form. Can anyone give me an idea of what I am doing wrong here?

>Thanks in advance,
>-Vinny


 
 
 

1. Importing default form fields into custom form fields?

Can this be done? We have a contact database of hundreds of contacts in a
public folder on exchange 2000. I had developed a custom form to help our
needs but now we're left with no "easy" way of getting all the old info
into the new form. Many of the fields (name, address, email, phone number,
etc) were left untouched. I was hoping to get that info into the new form
and input from there as needed.

Any ideas?

-=SW=-

2. delayed delivery incorrect time

3. custom fields appear in different form fields for different public folders

4. Contacts not visible after database restore.

5. Multiple Domains

6. Workflow Script Cannot Update Field In A Custom Outlook Form

7. outlook 8.2 for the mac

8. How can I access custom field in outlook 2000

9. Accessing Exchange Server Custom Fields in Outlook

10. Importing Custom Fields from Access into Outlook

11. Creating custom reports on custom fields added to contacts within Outlook/Exchange

12. Custom Forms & Outlook Web Access