how shut down an custom form

A

armando

hi, I havr created 2 custom form!
when an user receive the first, in this there is an action that allow
to forward the receive mail in tha new form to complite it!
the problem is that when the second appears the first doesn't shut
down!
I use this code but don,t work:

Function Item_CustomAction(ByVal Action, ByVal NewItem)
Select Case Action.Name
Case "Inoltra"
Item.close 0
Case "Passa lettera A.."
Item.close 0
Case Else

End Select
End Function
 
S

Sue Mosher [MVP-Outlook]

Does this work any better:

Set insp = Item.GetInspector
insp.Close 0

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
A

armando

i try, do not function because does not run the function:

Function Item_CustomAction(ByVal Action, ByVal NewItem)
Select Case Action.Name
Case "crea cartella"
insp.Close 0
Case "Passa lettera A.."
insp.Close 0
Case Else
insp.Close 0
End Select

MsgBox "ARMANDO CAZZETTA"
End Function

why do not execute thie code?

I have put
Function Item_Open()
Set insp = Item.GetInspector
 
S

Sue Mosher [MVP-Outlook]

Did you declare insp as a module-level variable?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
A

armando

can you expalin step by step this produres?
excuse me but I have a little knowlegement of this argument
 
S

Sue Mosher [MVP-Outlook]

Unless you have a statement like this at the beginning of your VBScript module:

Dim insp

you cannot set the value of insp in one procedure and expect to be able to use that value in another procedure.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
A

armando

hi, this is the code that I use:


Function Item_Open()
Dim insp
Set insp = Item.GetInspector
End Function


Function Item_CustomAction(ByVal Action, ByVal NewItem)
Select Case Action.Name
Case "crea cartella"
insp.Close 0
Case "Passa lettera A.."
insp.Close 0
Case Else
insp.Close 0
End Select

MsgBox "ARMANDO CAZZETTA"
End Function


why doesn't work?I publish my form iin the personal folder;
the problem is that when the receiver click the button of the action
"crea cartella", the functoin Item_CustomAction doesn't work! (infact
the MsgBox doesn't appear)
 
A

armando

but at the receiver the code that i write in the script editor does not
run, and so how can call the function?
 
S

Sue Mosher [MVP-Outlook]

Please reread my last response, which explained why you need to declare insp at the beginning of your code, before any procedures.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
S

Sue Mosher [MVP-Outlook]

If the form doesn't run code after you have sent or saved an item using the published 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.outlookcode.com/d/secforms.htm 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.outlookcode.com/d/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
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
A

armando

when i try to publish my form in the folder of organizzation, i can't
do it;
it tell me "ERROR IN TRASFERING IN THE FOLDER"
 
S

Sue Mosher [MVP-Outlook]

Talk to your Exchange administrator. Maybe they haven't created the Organizational Forms library yet. Or maybe you don't have permission to publish forms there.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
A

armando

ok, i have published the form in the folder of organization and now
run.
Thank you!
 

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