Outlook 2003 won't run vbscript in published form


M

Marty Peterson

Hello all,

I hope this is a simple one, but has me scratching my head...
I have organizational forms that work great for all versions of Outlook
older than 2003. However, when I open the form and click the button (causes
another form to open and copies data from the first form), nothing happens
when using Outlook 2003.

I have changed the code to only display a message box, but that doesn't even
work. I have changed the macro security in Outlook 2003 to the lowest level
to test, but it still does nothing when I click the button on the custom
form that is supposed to run the vbscript.

I am not using VBA-type language, but am using some simple vbscript. Is
vbscript not supported in Outlook 2003? Will I need to convert my code to
VBA?

thanks in advance,

Marty Peterson
 
Ad

Advertisements

S

Sue Mosher [MVP-Outlook]

Macro security has absolutely nothing to do with Outlook custom form code.

Do you see this problem both when you create new items and when you open
existing ones? Where are the items that use this form located -- in Public
Folders?
 
M

Marty Peterson

I see the problem when I open a new form from the Organizational Forms
library or if I open a previously saved one. Essentially, the code in the
form hasn't changed any for about 2 years. The code just opens a new form in
the Organizational forms library and copies data from the original form over
to it. Just for fun, I changed the code to display a message box and that
doesn't even work. It is almost like when I click the button that runs the
code, nothing at all is happening.

Of course, I can use Outlook XP or Outlook 2000 and it works like a champ.
It is only with Outlook 2003 that I have this problem. I just tried to
replicate this on another computer running Outlook 2003 and got the same
results. We are wanting to migrate our forms away from Org. Forms library
into Public Folders but haven't got that far yet when I ran into this
problem.

thanks

Marty
 
S

Sue Mosher [MVP-Outlook]

First thing to try is clearing the forms cache. Choose Tools | Options |
Other | Advanced Options | Custom Forms, then click Manage Forms, then Clear
Cache.

The bulk of the forms cache issues in Outlook 2003 are fixed in Service Pack
1, so you should also install Office 2003 Service Pack 1.

You didn't say where the items using this form are stored.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
M

Marty Peterson

I have SP1 already loaded. I cleared the forms cache and still have the same
results.

I am not sure what you mean when you ask where the items using the form are
stored...I guess items (fields) using the form are stored in the form, but
am not sure. When I look at the "All Fields" folder I see my custom fields
listed in the "user defined fields in this item" dropdown. I do notice that
nothing is listed in the "user-defined fields in inbox" dorpdown on the
Outlook 2003 computers, but do see a lot of items listed in this dropdown
for the previous Outlook versions.

The process that I use is to open the forms from the org. forms library,
fill it out (there are various check boxes and custom fields that are filled
out), then send the form to the recipient (me in my test cases). I then open
the form and see all of the data (grayed out), and have a button on the read
page, that when clicked displays a message stating that it will open a new
form and to fill out the info. I then click this button that should lauch
the vbscript code. In this code, it calls another form that is stored in the
org. forms library and copies the data from the custom fields into this new
form and puts the original sender in the "To" field. I then fill out more
information based on the check boxes that were checked in the original form
and send it off to the original sender.

Thank you for your quick response,

Marty
 
M

Marty Peterson

Yes, this is an IPM.Note message type item.

I am working from my own inbox as I have sent the item to myself, then
opened it and clicked the "button" that would normally run the vbscript.

thanks

Marty
 
Ad

Advertisements

S

Sue Mosher [MVP-Outlook]

Some terminology pointers:

Item = single data record, e.g. a contact, a message, a task
Form = code/UI layout for displaying an item, usually published rather
than saved as an .oft file
Property = data point in an item, e.g. the Subject property
Field = used interchangeably with "property"

So when you say:

I presume you actually mean "item" instead of "form."

So this is a message form? Are you working with items in your own Inbox or
in the Inbox of another user's mailbox?
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
S

Sue Mosher [MVP-Outlook]

Check the (Properties) page in design mode. The "send form definition with
item box" needs to be clear, not checked. I don't think that's the problem,
though, because it would affect all versions, not just OUtlook 2003.

Another thing to check is the value of the Message Class property for the
item you received. If it doesn't match the class that you published the form
under, we have to suspect that something is one-offing the item.

Do other forms run code on your Outlook 2003 machine?

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
M

Marty Peterson

I de-selected the "send form definition with item" box but it still doesn't
work. The Message Class property for the item I received is the same type of
IPM.Note.

I decided to create a whole new item, put a button on there that runs some
code that simply displays a message box. This doesn't work either. I can
take this same code, put it in the VBeditor (ALT-F11) and it runs without a
problem (My message box pops up). So it almost looks like when I click the
button that is supposed to run the code, it just won't launch. When I run
this new very simple item from an Outlook 2002 (XP or v.9) client, it first
prompts me to ask if I want to run macros, then runs as expected.

Thank you for all of your help....again...

Marty
 
S

Sue Mosher [MVP-Outlook]

I de-selected the "send form definition with item" box but it still doesn't

Did you republish the form and test with a new item? Code won't run on items
created from a form with that box checked.
The Message Class property for the item I received is the same type of
IPM.Note.

What do you mean? Is it IPM.Note or IPM.Note.MyPublishedForm?
I decided to create a whole new item, put a button on there that runs some
code that simply displays a message box. This doesn't work either. I can
take this same code, put it in the VBeditor (ALT-F11) and it runs without
a problem (My message box pops up). So it almost looks like when I click
the button that is supposed to run the code, it just won't launch. When I
run this new very simple item from an Outlook 2002 (XP or v.9) client, it
first prompts me to ask if I want to run macros, then runs as expected.

But did you publish the form first? Outlook 2003 will not run code at all on
unpublished or one-off items.
 
M

Marty Peterson

Ah ha!

No, I did not re-publish the form originally.
I just went back in, re-published the form to my personal forms library and
it still didn't work. Then I went back in and looked at the published from
that was in my personal forms library and noticed that that box was checked,
so I unchecked the box, re-published, and voila, it works!

Now I know...Outlook 2003 must have published forms for the code to run and
to uncheck the box. You probably mentioned that in one of the posts, but I
missed it...

Sue, once again, thank you for your help. I remember about 7 years ago when
we worked through a different issue regarding launching forms from a
hyperlink, we got it worked out then too...those were the good ol days...
:)

thanks again,

Marty
 
Ad

Advertisements

S

Sue Mosher [MVP-Outlook]

Glad to hear you got it working. It's scary, isn't it, how little forms have
advanced in that time?
 

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