Outlook Form

A

Amit Basu

Hi,

I am sort of new to Outlook forms and am experiencing a problem. My
Outlook form has a different Read Page from the compose page. I have a
button control on the Read page and I added a Click event handler for
the button. When I click the button on receiving the form, the handler
doesn't get invoked. But if I put the button in the Compose form, it
works fine. Is there something special I have to do for event handlers
to work in my Read form?

Please help.
Amit.



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
S

Sue Mosher [MVP]

There are two major causes of code in an Outlook form not running -- 1) security settings in Outlook 2003 and 2) the broader form script security features introduced with the Outlook Email Security Update.

#1: Outlook 2003 includes a new setting -- turned off by default -- to allow forms in shared mailboxes to run script. You can change the setting by choosing Tools | Options | Other | Advanced Options and checking the box for Allow script in shared folders. See http://www.slipstick.com/dev/ol2003problems.htm#mailboxscript for more information on this setting and a comparable one (on by default for public folders).

#2: If the form runs code when you use Run This Form in design mode, but doesn't run code after you have sent or saved an item using the form, you probably have done something to "one-off" the form. Outlook 2003, Outlook 2002, Outlook 2000 SP2 and Outlook 2000 or 98 with the Email Security Update will not run code on one-off forms; see http://www.slipstick.com/outlook/esecup.htm#formsec for more information on this issue.

To ensure that a form does not one-off:

-- Make sure the "Send form definition with item" box on the (Properties) tab of the form is *not* checked. [1]

-- For in-house corporate use with Exchange Server, publish the form to the Organization Forms library or a public folder's forms library, as appropriate for your application.

-- For collaboration via the Internet, publish your form to your Personal Forms library. Save it as an .oft file and send it to other people who need to use it with instructions to publish it with the same form name that you used.

Many other things can cause one-off forms. If the above steps don't work on a new item created with your form, see http://www.slipstick.com/dev/formpub.htm#oneoff for other possible causes.

[1] Whenever you publish a message form, Outlook will suggest that you may want to check the "Send form definition with item" box to ensure that the recipient will have the form, especially if you're sending to someone via the Internet. In the current Outlook security environment, this suggestion is obsolete. Ignore it unless your form has no code behind it.

--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
A

Amit Basu

Thank you Sue. You were right, it was a one-off. A follow up question, I
had the property checked to "Send Definition along with the form" as I
need to send this form to a different exchange server outside of our
server/site. The recipient was not receiving the form when I didn't have
the property set. Now that I cannot have the property set what do I do
so that they can receive it? Have the form published in their
Organizational Forms Lib or those recipient's Personal Forms Lib?

Thank you again.



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
S

Sue Mosher [MVP]

Yes, if you want your form to be totally functional, the recipient needs access to the published form definition, either in their Org Forms or Personal Forms library.

--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
A

Amit Basu

Thanks again Sue.
Have a couple of other questions. This is what I am trying to do. I have
a button on this form that is active for the recipient. The button
should send a reply to all in the mailing list when clicked. I have this
code in the Click event handler for the button:

Sub AckButton_Click()
Set myNameSpace = Application.GetNameSpace("MAPI")
Set myOlApp = CreateObject("Outlook.Application")
Set replyItem = myOlApp.CreateItem(olMailItem)
replyItem.To = Item.Sendername
replyItem.Subject = "ACK:" + Item.Subject
replyItem.Send
End Sub

When this code executes, I get an Outlook security popup message
prompting me whether to allow access to address stored in my Outlook to
this program. And then again it shows another warning message notifying
me that a program is trying to send an email automatically on my behalf.
I know these are Outlook Security settings but don't know which settings
I can change so that I don't see these popup messages.

Another question: Say I send this form to a bunch of people. I need each
recipient to click this button so that I get the response from all of
them. What can I do to programatically keep track of who hasn't sent me
a response, and may be send a follow-up mail to that person?

Thanks a lot again for your help.


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
S

Sue Mosher [MVP]

The security dialogs that pop up when an application tries to access certain Outlook properties and methods are designed to inhibit the spread of viruses via Outlook; see http://www.slipstick.com/outlook/esecup.htm#autosec. They cannot be simply turned on or off with a user option or registry setting.

However, Outlook 2003 does not show security prompts on three specific types of applications:

-- VBScript code in published, non-oneoff Outlook forms

-- Outlook VBA code that uses the intrinsic Application object

-- Outlook COM add-ins properly constructed to derive all objects from the Application object passed by the OnConnection event

In earlier versions of Outlook, standalone users can use a free tool called Express ClickYes (http://www.express-soft.com/mailmate/clickyes.html) to click the security dialog buttons automatically. Beware that this means if a virus tries to send mail using Outlook or gain access to your address book, it will succeed.

If you're the administrator in an Exchange Server environment, you can reduce the impact of the security prompts with administrative tools. See http://www.slipstick.com/outlook/esecup/admin.htm

If it's an application you wrote yourself and either your application needs to support versions besides Outlook 2003 or your application runs extenal to Outlook, you have these options for modifying your program to avoid the security prompts (roughly in order of preference):

-- Use Extended MAPI (see http://www.slipstick.com/dev/mapi.htm) and C++ or Delphi; this is the most secure method and the only one that Microsoft recommends. However, it applies only to COM add-ins and external programs; you cannot use Extended MAPI in Outlook forms or VBA.

-- Use Redemption (http://www.dimastr.com/redemption/), a third-party COM library that wraps around Extended MAPI but parallels the Outlook Object Model, providing many methods that the Outlook model does not support

-- Use SendKeys to "click" the buttons on the security dialogs that your application may trigger. See http://www.slipstick.com/outlook/esecup.htm#autosec for a link to sample code.

-- Program the free Express ClickYes (http://www.express-soft.com/mailmate/clickyes.html) tool to start suspended and turn it on only when your program needs to have the buttons clicked automatically.

It's up to you to decide what you want to do with the incoming items. A good start might be to use a rule to put them in their own folder. You could then use the MAPIFolder.Items.ItemAdd method to monitor the folder for new items and do whatever you want with them.
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 

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