Custom Form One-Off Fix?

B

Boyd

It appears that I have a one-off corruption issue. I have no idea how
this happened, but I'm looking for the best way to fix it.

My reason for assuming this is because a button's Click event isn't
running after I save the form. Although, if I open the form in Design
view, and click 'Run This Form', the click event runs fine.

I've verified that the 'Send Form Definition With Item' checkbox is
unchecked. I've also checked that the message class is using my custom
form name, which it is. I can't figure out why else the code wouldn't
run when the button is clicked. By the way, the only code in the
Script Editor is :
<code>
Sub cmdTest_Click()
msgbox "Test Button Clicked"
End Sub
</code>

Assuming that the form is one-off, I created a new custom form, copied
and pasted my controls (about 350 of them), added my 3 lines of code,
published it in my 'Personal Forms Library', and re-ran the form ...
still no reaction when the button is clicked.

Any help would be greatly appreciated.

Thanks,
Boyd
 
H

Hollis D. Paul

Boyd said:
Assuming that the form is one-off, I created a new custom form, copied
and pasted my controls (about 350 of them), added my 3 lines of code,
published it in my 'Personal Forms Library', and re-ran the form ...
still no reaction when the button is clicked.
A Better or Best Practice in the development of a custom form is to make
small changes and save each new version with the version number in the
"publish as" name of the file--MyForm_Ver001. Keep a minimum of 3
generations of the form so that you can always back up to a prior form
to get a good recovery point. I generally keep 10 or 15.

There is a limit of 32K memory usage after which a form will fail just
for being too complicated. 350 controls has probably pushed you past
that form. You will really have to start over with a simplified design.

Hollis D. Paul [MVP - Outlook]
Mukilteo, WA USA
 
B

Boyd

Thanks Hollis. I agree that 350 controls is probably not a good idea.
However, I'm starting to think there may be something else to blame for
the problem that I'm having. I just created a new customized form with
a command button. This is the only control on the form. I added code
to display a message box when clicked. When I save the form to my
C:\Drive, then open it, the message box is not displaying. Although,
when I publish the form to my Inbox, and open the form from there, the
message box pops up.

Why does the code only work on published forms?
Any ideas?

Boyd
 
H

Hollis D. Paul

<[email protected]>
<[email protected]>
Newsgroups: microsoft.public.outlook.program_forms
NNTP-Posting-Host: h-68-167-254-208.sttnwaho.dynamic.covad.net 68.167.254.208
Path: number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!logbridge.uoregon.edu!hammer.uoregon.edu!nrc-news.nrc.ca!msrn-out!msrtrans!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
Lines: 1
Xref: number1.nntp.dca.giganews.com microsoft.public.outlook.program_forms:75325

Why does the code only work on published forms?
Any ideas?
That is how they are designed to work. The data item is stored
separate from the form information. When a data item is selected for
display, Outlook looks first in the Exchange Forms Library, then in the
pst forms library, finally, in the default folder of the same type as
the message for the forms definition. Form defs found in any of these
three places are deemed "trusted". I don't know the specifics but I
think that forms saved in the file system are no longer trusted, and
code will not be run in them unless you set your security to low. Not
necessarily a good thing to do. But it is all part of Microsoft's push
to secure computing--Big Brother knows what is best for you!

Hollis D. Paul [MVP - Outlook]
Mukilteo, WA USA
 
B

Boyd

Thanks Hollis, this makes sense.
One thing I still don't understand ... when I open my published form
and click the command button, the message pops up. If I email the same
form to myself, open it, and click the button, nothing happens. I
would assume that I somehow one-off'ed the form (b/c the code is not
firing), but the code works fine before I send the email.

Any ideas??

Thanks,
Boyd
 
B

Boyd

To make this even more bizarre ... the vbScript fires in different
scenarios.
Basically, I've written VBA code in Access to open a new custom form
(published to my Inbox). The code then populates the controls on the
form with data from my db, and waits for me to click Send.

Scenario 1 (doesn't work): With the populated outlook form displayed,
I click the command button and the msg box appears. If I click Send,
open the email once it arrives in my Inbox, and click the command
button again, nothing happens .. no msg box.
Scenario 2 (works): If I open the outlook form from within my Inbox
(not populated with data from my Access db), and click the command
button, the msg box appears. If I click Send, open the email once it
arrives in my Inbox, and click the command button again, the msg box
fires again.

I just can't understand why it works one way, and not the other.
Any ideas?

Thanks,
Boyd
 
H

Hollis D. Paul

<[email protected]>
<[email protected]>
Newsgroups: microsoft.public.outlook.program_forms
NNTP-Posting-Host: h-68-167-254-208.sttnwaho.dynamic.covad.net 68.167.254.208
Path: number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!router2.astraweb.com!news.astraweb.com!router1.astraweb.com!news.alt.net!msrtrans!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
Lines: 1
Xref: number1.nntp.dca.giganews.com microsoft.public.outlook.program_forms:75338

Boyd said:
One thing I still don't understand ... when I open my published form
and click the command button, the message pops up. If I email the same
form to myself, open it, and click the button, nothing happens. I
would assume that I somehow one-off'ed the form (b/c the code is not
firing), but the code works fine before I send the email.

Any ideas??
I asked for backup in my private Outlook list and Eric sent the following
comment.

"Is the form published in his Personal Forms library? It could also be a
Rich Text issue:

How e-mail message formats affect Internet e-mails in Outlook:
http://support.microsoft.com/default.aspx?scid=kb;en-us;290809

Eric"

Also, we should establish what version of Outlook you are using. As you
can see from the KB, it does make a difference.

Hollis D. Paul [MVP - Outlook]
Mukilteo, WA USA
 
B

Boyd

Hollis, thanks for following up. My form is published in my Inbox.
I changed the Mail Format to Rich Text, as suggested in the link, but
no changes in respect to my issue.

I posted a message this morning that never seemed to make to this
thread. In summary, I'm noticing differences in the behavior of my
form. For instance, if I open the published form from my Inbox, and
send it to myself, the vbScript fires perfectly. However, if I open
the published form thru Access VBA, and send it to myself, clicking my
command button does nothing. The Access code is fairly straightforward
... it basically populates my custom controls with data from the
database.
One other note, the icon of the message is different, depending on the
way it is opened. If opening from within my Inbox, and sent, I receive
the Post icon (paper and thumbtack). If opened from Access code, and
sent, I receive the standard envelope icon.

Does any of this ring a bell?

Thanks again,
Boyd
 
H

Hollis D. Paul

<[email protected]>
<[email protected]>
Newsgroups: microsoft.public.outlook.program_forms
NNTP-Posting-Host: h-68-167-254-208.sttnwaho.dynamic.covad.net 68.167.254.208
Path: number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!pd7cy2so!pd7cy1no!shaw.ca!news.alt.net!msrtrans!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP15.phx.gbl
Lines: 1
Xref: number1.nntp.dca.giganews.com microsoft.public.outlook.program_forms:75340

Any ideas??
Ken Slovak has pointed out that any custom form with code in it has to
be sent with the TNEF wrapper. You set this by selecting and opening
the target person's contact item, selecting and right-clicking the
email address you will use, and choosing Properties. Depending on the
version of Outlook you are using, there is a check box that is labeled
"Always send this message using rtf", or in Outlook 2003, there is a
e-mail format drop-down list box, one choice of which is RTF. Make
sure the checkbox is selected or the e-mail format is RTF in the list
box. Now try sending your test form to yourself and see if the message
box appears when you receive it.

I don't recall ever using the <code> tags in adding script to a form.
Are you sure that isn't causing problems?

Hollis D. Paul [MVP - Outlook]
Mukilteo, WA USA
 
H

Hollis D. Paul

<[email protected]>
<[email protected]>
<[email protected]>
Newsgroups: microsoft.public.outlook.program_forms
NNTP-Posting-Host: h-68-167-254-208.sttnwaho.dynamic.covad.net 68.167.254.208
Path: number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!msrtrans!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP14.phx.gbl
Lines: 1
Xref: number1.nntp.dca.giganews.com microsoft.public.outlook.program_forms:75345

I just can't understand why it works one way, and not the other.
Any ideas?
Well, it could be that when you are sending it from Access, you aren't
getting the TNEF wrapper. Have you set the rtf button on you contact
data item? Do you see the data when sent from Access?

We haven't established some basic parameters for your system. Are you
working in a network with Exchange? What version of Exchange and what
version of Outlook. I assume you are using Office--what version of
that?

Hollis D. Paul [MVP - Outlook]
Mukilteo, WA USA
 
B

Boyd

Hollis - Thanks again for your help. It seems that Google had some
issues with a delay in posting messages. My responses on Friday took a
while to show up ... and one didn't seem to show up at all.
I believe that I've narrowed the issue down further. It seems that the
problem with my Access code resulted from attempting to populate custom
outlook controls that were locked. For some reason, after setting
Locked = False, the message went thru without a problem, and the
vbScript fired perfectly.
A major problem that I'm still experiencing is data in a few custom
controls not showing up after the form is sent. For example, I
manually open the published form (not thru Access code), enter data
into a number of fields, and email it to myself. When I receive it in
my Inbox, some of the fields are still populated, and some are now
blank.
The controls' properties seem to be set up appropriately, so I'm not
sure why the data is being lost.

Thanks for any insight,
Boyd
 
B

Boyd

My last reply failed to mention some basic parameters. I'm using
Office 2003, and am attached to an Exchange server (not sure of the
version). The form will not be published in a folder where people will
have access. I will be sending the form out to a number of people once
a week. Each person will enter data into a number of fields (progress
metrics - percentages between 0 and 100). Once complete, they will
click a Submit button, and the form will be emailed to my inbox
(haven't yet figured out this code). I'm a complete novice to Outlook
programming, but am enjoying what I've learned so far.

Thanks again for your help.
Boyd
 
H

Hollis D. Paul

<[email protected]>
<[email protected]>
Newsgroups: microsoft.public.outlook.program_forms
NNTP-Posting-Host: h-68-167-254-208.sttnwaho.dynamic.covad.net 68.167.254.208
Path: number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!news.alt.net!msrtrans!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
Lines: 1
Xref: number1.nntp.dca.giganews.com microsoft.public.outlook.program_forms:75356

Boyd said:
My last reply failed to mention some basic parameters. I'm using
Office 2003, and am attached to an Exchange server (not sure of the
version). The form will not be published in a folder where people will
have access.
Exchange has an Organizational Forms Library where forms should be
published. That is where Outlook first looks for the form. You really
do not want to send the form to N individuals, because, when you change
it later, then you have to get those N individuals to delete the old
forms, and republish them. Learn to use the facilities that Exchange
makes available to you. You can control who has access to a form by
restricting the ACL of the form itself.

If you do not see the Organizational Forms Library on your list of where
to publish forms (it should be the very first one!), Then you will need
to have the Exchange Administrator create it or/and give you permissions
to write to it.



Hollis D. Paul [MVP - Outlook]
Mukilteo, WA USA
 
H

Hollis D. Paul

<[email protected]>
<[email protected]>
Newsgroups: microsoft.public.outlook.program_forms
NNTP-Posting-Host: h-68-167-254-208.sttnwaho.dynamic.covad.net 68.167.254.208
Path: number1.nntp.ams.giganews.com!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!news.alt.net!msrtrans!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
Lines: 1
Xref: number1.nntp.dca.giganews.com microsoft.public.outlook.program_forms:75357

The controls' properties seem to be set up appropriately, so I'm not
sure why the data is being lost.
Have you bound the controls to a User Defined Form in the Folder?

Hollis D. Paul [MVP - Outlook]
Mukilteo, WA USA
 
B

Boyd

Hollis .. Thanks for the insight. My current situation does not allow
me to publish forms to the Organizational Forms Library. If so, this
whole process would most likely run smoother.
I've pretty much resolved the issues with data not showing up after the
message was sent. Originally, I just copied and pasted my controls
into a new Outlook form. Even though the controls appeared to be bound
to the user defined form, they weren't displaying the data. I went
thru each control, and re-bound the user defined fields. This seemed
to work.
My form is now sending all data, and the vbScript is running
successfully.

Again, I appreciate your time in helping me resolve my issues.
Hopefully, it's all downhill from here.

Thanks,
Boyd
 
H

Hollis D. Paul

<[email protected]>
<[email protected]>
Newsgroups: microsoft.public.outlook.program_forms
NNTP-Posting-Host: h-68-167-254-208.sttnwaho.dynamic.covad.net 68.167.254.208
Path: number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!msrtrans!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
Lines: 1
Xref: number1.nntp.dca.giganews.com microsoft.public.outlook.program_forms:75388

Boyd said:
Originally, I just copied and pasted my controls
into a new Outlook form. Even though the controls appeared to be bound
to the user defined form, they weren't displaying the data. I went
thru each control, and re-bound the user defined fields. This seemed
to work.
The paste of controls is very flakey. Another problem is that if a
control of the same name is already in the form, the pasted control will
be given a different name. Another hard one to find.

Hollis D. Paul [MVP - Outlook]
Mukilteo, WA USA
 

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