Link to home
Start Free TrialLog in
Avatar of NICO
NICO

asked on

Problem with CustomAction in VBScript

In general, I can't interact with NewItem (the new mail item created after the user click on the action button from the current item).For example this simple code that should add a small message to the body of NewItem doesn't work :

Function Item_CustomAction(ByVal Action, ByVal NewItem)

     Select Case Action.Name
          Case "Approve"
               set NewItem =Application.ActiveInspector.CurrentItem (same result if I remove this line)
               NewItem.Body = "test"
          end with
     End Select

End Function

I would be very grateful if anyone could help me this this issue. Thank you very much.
Avatar of Richie_Simonetti
Richie_Simonetti
Flag of Argentina image

i suposse you are talking about outlook, right?
yup looks like it and i'm curious if someone is going to solve this one

:O)Bruintje
Avatar of NICO
NICO

ASKER

Yes, this problem is happening on a custom form I am trying to develop in  VBScript in Outlook 2002 (XP).
Avatar of NICO

ASKER

Yes, this problem is happening on a custom form I am trying to develop in  VBScript in Outlook 2002 (XP).
we got a same sort of trigger problem in Office at the moment no solution thus far although there is some heavy weight Outlook expert involved, the documentation of MS is clear only in practice it's a different story or we miss something really obvious here

i'll be on the lookout
Avatar of NICO

ASKER

I've found the reason why it didn't work but I don't know how to fix it.
Microsoft says that the Email Security features of Outlook XP "one-off" forms  when using
methods  related to the Action object (and so the VBscript code is prevented from running). The small easy code in my original question that adds a line in the body of the new mail item generated by a custom action  works perfectly in outlook 2000 (without the security patch).

I tried with no success these different solutions to remove the one-off state of the form :
- uncheck the option "send form definition with item" and/or publish the form in the Organisational Library
- resetting the message class field with code and saving the item in code.

Microsoft speaks about administrator features to enable Vbscript in one-off forms but I have no idea of what it can be.

So my question now is does anyone know how to successfully enable VBscript in one-off form except the solutions I tried above?

Thanks a lot
Avatar of NICO

ASKER

Hi,

Finally, the solution was found :

It is just a matter of publishing the form in a form library in exchange and unselecting the option "send form definition with item " (I don't know why it didn't work previously )
NICO, an EE Moderator will handle this for you.
Moderator, my recommended disposition is:

    Refund points and save as a 0-pt PAQ.

DanRollins -- EE database cleanup volunteer
ASKER CERTIFIED SOLUTION
Avatar of Computer101
Computer101
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial