Solved

Problem with CustomAction in VBScript

Posted on 2002-04-24
9
129 Views
Last Modified: 2011-04-14
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.
0
Comment
Question by:NICO
9 Comments
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6967098
i suposse you are talking about outlook, right?
0
 
LVL 44

Expert Comment

by:bruintje
ID: 6967406
yup looks like it and i'm curious if someone is going to solve this one

:O)Bruintje
0
 

Author Comment

by:NICO
ID: 6967850
Yes, this problem is happening on a custom form I am trying to develop in  VBScript in Outlook 2002 (XP).
0
 

Author Comment

by:NICO
ID: 6967852
Yes, this problem is happening on a custom form I am trying to develop in  VBScript in Outlook 2002 (XP).
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 44

Expert Comment

by:bruintje
ID: 6967859
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
0
 

Author Comment

by:NICO
ID: 6968742
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
0
 

Author Comment

by:NICO
ID: 6993964
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 )
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7670194
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
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 8092518
Question placed in PAQ

Computer101
E-E Admin
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now