Populate Message field based on custom field

K

Kryer

I am using outlook 2003, trying to create a custom form where the compose
page has several custom fields and the read page contains just the "Message"
field. I want the values from the custom fields to populate into the
"Message" field, however I can not seem to determine how to do this. I have
tried to write the code using the script editor using the item.message,
item.userproperties, or item.userproperties.find methods and keeps telling me
that it cannot do it.

I seem to have to do this because custom forms do not seem to show up in the
reading pane or preview pane so I am hoping that by taking the values in the
custom fields and write them to the message field it will allow the values to
be seen with out opening the actual email.

Can someone help me with this?
 
H

Hollis Paul

Can someone help me with this?
If you look through the Outlook objects with the Outlook object browser
(F2 in the script code editor), I think you will find one called body.
That is the one to use for the message control.
I seem to have to do this because custom forms do not seem to show up
in the reading pane or preview pane

I don't think this is correct. I suspect that your custom fields are
not showing up because you are not defining the controls in the read
page properly. To get custom controls to automatically show data, that
was entered in the compose page, in the read page, you need to create
the common controls first in the unsplit form, then split the form and
create the unique features. I could be wrong about this, as it has
been a long time since I played with split forms--there is really very
little need for a split form, and it mostly happens by accident because
Outlook 2003 opens a form in split mode when you first choose design a
form. That is when you should deselect the Separate Read Form option
on the forms menu if you do not really, really need the split form
feature.
 
K

Kryer

I attempted to use the suggested method shown by example in the help file but
was unable to get it to work. Any other suggestion or are you able to provide
a little more walk through than what the help file attempts to do?
 
H

Hollis Paul

I attempted to use the suggested method shown by example in the help file but
was unable to get it to work. Any other suggestion or are you able to provide
a little more walk through than what the help file attempts to do?
Since it has been so long since I dealt with the Outlook help file I have no
idea what it says. Worse, I have little stomach for delving into it again.

What were you not able to do? Could you not find the Message object in the
Object model?
 
D

dch3

There is hope for your post-Microsoft help stress disorder. You may be
feeling as if you're alone in this or as if its your fault or that your just
plain stupid because you don't understand the information in the file or
can't find what you're looking for. You are not alone.

David

(Case in point, I recently spent two or three hours pulling my hair out
trying to figure out how the crap to use the .Selected property of a listBox.
My God, it would have helped if the article explicity stated that when
working with the property that you're actually working with an array and that
it return ALL values in the listBox not just the specific items selected.)
 
K

Kryer

I found it but I entered the example they provided and attempted to recreate
what the help file was getting at and it wouldnt work. The help file
basically stated to us VBScripteditor and use the open function and do an
item.body = "what ever you wanted to put into this spot", then end the
function and it was supposed to add the message written above into the body
of the message everytime you opened a new email. Couldnt get it to work.

Anyone else out there that can help explain what I am not getting?
 
H

Hollis Paul

There is hope for your post-Microsoft help stress disorder. You may be
feeling as if you're alone in this or as if its your fault or that your just
plain stupid because you don't understand the information in the file or
can't find what you're looking for. You are not alone.
Actually, I think I am in the "Nobody loves me!" Phase. I camp on my various
inboxes removing hundreds of spam emails. I really would prefer discussing
such topics as how the habit of "making traffic lights" is the start of the
slippery slope that leads to bursting through red lights at the start of the
cycle and on to downright terrorism in the body politic when people no longer
voluntarily obey laws for the common good with my brothers and family. Alas,
they are focused on baseball games, and football, wherein hero/role-modelers
engage in the same terrorism, but on a grander scale. Practical philosophy is a
lonely field.
 
M

mattmansd

It took me a long while to figure this out, but it is very simple.
use the Item_Send() function and set the "Body" variable to whatever
test you want.
See my example below:
The fist line removes all text from the body
The rest of the lines appends the value of the variables from the fields
from the compose page, to the body of the message field.
Try it, you'll like it!


Function Item_Send()
Body = ""
Body = Body & "RFC #"&
UserProperties.Find("InsertFieldNameHere").Value & vbcr
Body = Body & "RFC #"&
UserProperties.Find("InsertFieldNameHere").Value & vbcr
End Function



*** Sent via Developersdex http://www.developersdex.com ***
 

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