PDA

View Full Version : Custom form: values in form copied to 'message' tab



WallIT
02-21-2013, 04:35 AM
Hi,

We have a simple custom form which has a number of text box entries on the P.2 tab (all other tabs are hidden). The form works fine when viewed in Outlook, but appears blank when viewing on a BlackBerry/iPhone. I understand custom forms will only work properly when viewed in Outlook.

After some more testing I noticed the mobile devices were actually displaying the 'message' tab. I ended up adding a line to the 'message' tab saying "Please use Outlook to view this email", which shows up on a mobile device (and not on Outlook, because that tab is hidden). This is fine and at least gives some guidance to users.

Now I am wondering whether I can go a step further, and have the values which users enter into the custom form (on tab p.2) copied to body of the 'message' tab on send.

We already have a few lines of code triggered by Function Item_Send(), so it would seem possible to copy the field values to the 'message' tab at the same time.

However, I'm not sure how to get started. When I look at the properties for the message body the name appears as "_DocSiteControl1". If someone has typed into fields TextBox1, TextBox2 and TextBox3, how can I copy these values to the 'message' tab?

Thanks in advance.

PS: we are (still) using Outlook 2003

WallIT
02-26-2013, 10:44 AM
I found my own answer after much searching. I used...

Function Item_Send()
item.body = "This is the name of the 1st person" + UserProperties.Item("TextBox1").Value &_
Chr(13) & Chr(10) &_
"This is the name of the 2nd person" + UserProperties.Item("TextBox2").Value &_

...so in summary, the bit I needed was

userproperties.item("itemname").value

the &_ allows the code to go to the next line without breaking

the Chr(13) & Chr(10) is a carriage return