?
Solved

Problem with CustomAction in VBScript

Posted on 2002-04-24
9
Medium Priority
?
163 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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
 
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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses

850 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