?
Solved

Problem with CustomAction in VBScript

Posted on 2002-04-24
9
Medium Priority
?
159 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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

649 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