Created Form, Published it, but sent emails don't have form data

D

duugg

Hi all,

I created a form in Outlook with Tab stops and a drop down box, but when I
click "run this form" fill it out and send the email out, NONE of the data is
in there, not even the Label text, what am I doing wrong?

Thanks in advance
 
K

Ken Slovak - [MVP - Outlook]

Are you storing the control data from your custom form in user properties?
If you don't bind your controls to user properties or standard properties
the values won't persist. See the forms information at www.outlookcode.com
for more information on binding controls to properties.
 
D

duugg

Ken,

Thanks for the fast reply. How do you bind a control? ie "Right click on the
text field, advanced properties...etc..."

thanks
 
K

Ken Slovak - [MVP - Outlook]

Properties, go to the Value tab. Either create a new property there or set
the control value to bind to an existing property.
 
D

duugg

Yes, I know that part, but how do I know which one to bind it to? In other
words, I created a text label that says "Matter Number" and right next to it,
I have a text box that I created for myself to enter data in.

I right clicked on my newly created text box, selected properties, selected
the "Value" tab, selected the "Choose Field" box and can't find "Matter
Number".

Do I create a new value with the exact same label name (Matter Number)? If
yes, how does Outlook know that I want it to bind to the EXACT same label
name in the form I'm working on?

I did manage to get the form text to show up in my sent messages, but the
data I entered in still doesn't show.

One more thing...is there a way to get the form to show up in the
Auto-Preview box? My form (without the text I entered) only shows up after
double clicking on the sent message, but not in the preview box.

Thanks for all your help.
 
K

Ken Slovak - [MVP - Outlook]

The property won't exist unless you create it. You can name it whatever you
want to name it, it can have the same name as your text box control or any
other name you want to give it.

What auto-preview box? Do you mean the preview/reading pane or do you want
your field to show up in auto-preview in table views?
 
D

duugg

Ken,

Actually I meant the "Reading Pane". I can't see the form when viewing it
from the reading pane (not actually opening it)
 
K

Ken Slovak - [MVP - Outlook]

It's normal not being able to see custom forms in the reading pane.
 
D

duugg

Okay,

I would like to do the "abnormal" and be able to see it from the reading
pane. Is this possible?
 
D

duugg

I actually found code that allegedly makes this work but don't know where to
put it for it to work. Can you tell me step by step where to put this code so
that I can try it and see if it works? Thanks much.



This code was posted in microsoft.public.outlook.program_forms and to give
her credit...by kristan.mcdonald@googlema­il.com

SEE CODE BELOW...



Ok, finally managed to get this working, you can have as much code etc.
in your custom form as you want, but STILL have it display properly in
the preview pane.

Basically there's a CDO property (0x8002) which controls whether
outlook should render the preview pane or not. When sending the message
with the custom code, if you set this to zero, when received your mail
will render in the preview pane correctly.


It was a bit tricky to get working, in the end I had to write an addin
to watch for send events with the message class matching my own and
then do the following (in the current mail send event):


If objCurMail.MessageClass = "IPM.Note.MyMessageClass" Then
On Error Resume Next
Dim objCDOMail As MAPI.Message


objCurMail.Save 'Need to save to get an entryID


Dim strEntryID
Dim strStoreID
strEntryID = objCurMail.EntryID
strStoreID = objCurMail.Parent.StoreID
'Get the mail via CDO
Set objCDOMail = gobjCDO.Session.GetMessage(strEntryID,
strStoreID)


If Not objCDOMail Is Nothing Then
'We've got our mail, set the property
objCDOMail.Fields.Add -2147352573, 0, 0,
"2903020000000000C000000000000046"
'Update the mail
objCDOMail.Update True
End If


'Send it via CDO
objCDOMail.Send
'Use our addin to close the mail and the inspector
objCurMail.Close (olSave)
objCurInsp.Close (olSave)


Set objCDOMail = Nothing
Set objCurMail = Nothing
End If


Now I'm no Outlook programming guru, so this can probably be tidied up
lots and tested further, but now when I send an email, it arrives and
the preview pane works - and I need to get the rest of the development
finished now!


Feel free to email if you have any comments/suggestions, I hope this is
helpful to someone!


Kristan
 
K

Ken Slovak - [MVP - Outlook]

Nice thought, but that code doesn't work. I just tried it.

What the code would actually have to do would be to delete the SideEffects
property or set it to 0 from the item in Sent Items to allow it to be seen
there, SideEffects is
"http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/85100003"
in DASL property tag syntax. On the receiving end the code would have to
delete the same property or set it to 0.

I didn't bother testing what possible side effects deleting the SideEffects
property might have, but doing that does make the item visible in the
preview pane. Be aware that there might be side effects to doing that.

The property tag for that is not 0x8002, it's 0x8510.

So the correct lines for the property would be:

Dim oField As MAPI.Field
Set oField = objCDOMail.Fields.Item("0x8510",
"0820060000000000C000000000000046"
oField.Value = 0
objCDOMail.Update True

However, as I said that only works on the items after sending when in Sent
Items or after receiving in the recipient Inbox.

In addition, the code as written doesn't instantiate or logon to the
MAPI.Session object (or even declare it) and sending using CDO will trigger
the security warning dialog.
 
M

Michael Edmison

I have a question to the "bind that field to. . " My fields don't show
up from the "Edit Compose Side" for me to bind it to in the "Value Tab"
How can I fix this?

Issue: When I fill out the field and send it, the value of this text box
will not show on the email when I open it.


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

Ken Slovak - [MVP - Outlook]

I have no idea what you're talking about. Please do not hijack other threads
for your questions.

Provide a complete explanation of what you are trying to do, what's
happening and what's not happening. Also list your Outlook version. You can
also look at the forms information on binding controls to properties at
www.outlookcode.com.
 
H

Hollis Paul

Michael Edmison said:
I have a question to the "bind that field to. . " My fields don't show
up from the "Edit Compose Side" for me to bind it to in the "Value Tab"
How can I fix this?
There are two unspoken rules to prevent this problem.

1) If you don't need unique differences between the compose and read
forms, do not split them. I know that on some versions of Outlook, the
custom form template opens up in split mode. I think this was a terrible
choice my Microsoft, even if it stopped some wails about not knowing how
to split forms. But there are even more people who are not using split
forms when they have no need to do so, and are experiencing the
difficulties that you have.

2) Design the common elements first, then split the form. When you do
this, the read form controls that are automatically created in the
splitting operation use the compose form name, and you see their content
as expected.

So, assuming that you really do not need a split form, you should uncheck
the option in the forms menu that gives you the split forms. It will
gnash its teeth and say that you will lose all your design on the read
form, but as you really do not have any unique stuff there, you OK the
loss and all is well, with the reader seeing all that the composer sees.

If, by chance, you actually do have some unique elements on the read
form, copy them, unsplit the form losing whatever, split the form again
so that all the common controls are set up properly, then paste in those
controls that you copied.
 
J

jalign

I'm having a similar issue. I created my form and the text labels and data do
not show up when the message is sent. (even if I open the message up--not via
reading pane). Can you walk me through this? Thanks!
 

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