ol 2003 contacts form questions

  • Thread starter Thread starter Gary Keramidas
  • Start date Start date
G

Gary Keramidas

i'm used to writing vba in excel, but someone wants some code for outlook. since
i never use outlook, my question is:

how do you address the large note field on the general tab of the contact form?
every other field has a name, this one shows nothing.

i just want to enter some data in there automatically.
 
thanks sue, but isn't body the body of the actual email? if they're both named
body, how do you distinguish one from the other?

--


Gary


Its name is Body.
 
If you look at the object browser in VBA, you'll see that every Outlook item object has a Body property, from MailItem to ContactItem, etc., just as every item has a Subject property.
 
well, it doesn't seem to work anything like excel.

here's what i have and it doesn't work. i just want to add text to the body of
the open contact.

Sub Add_text()
Dim olapp As Outlook.Application
Dim objmail As Outlook.ContactItem
Set objmail = olapp.Item(olContactItem)
With objmail
.Bodyitem = "test"
End With
End Sub

--


Gary


If you look at the object browser in VBA, you'll see that every Outlook item
object has a Body property, from MailItem to ContactItem, etc., just as every
item has a Subject property.
 
The basic principles work just like Excel: Objects need to be properly instantiated, and you have to use the property names that the object browser tells you about, not make up an Application.Item or ContactItem.Bodyitem property.

First, instantiate your Outlook.Application object:

Set olApp = CreateObject("Outlook.Application")

Then, instantiate the open contact:

Set objMail = olApp.ActiveInspector.CurrentItem

Finally, set the Body property:

objMail.Body = "test"
 
got it, thanks sue.

--


Gary


The basic principles work just like Excel: Objects need to be properly
instantiated, and you have to use the property names that the object browser
tells you about, not make up an Application.Item or ContactItem.Bodyitem
property.

First, instantiate your Outlook.Application object:

Set olApp = CreateObject("Outlook.Application")

Then, instantiate the open contact:

Set objMail = olApp.ActiveInspector.CurrentItem

Finally, set the Body property:

objMail.Body = "test"
 
Back
Top