Hi, it's me again. Thanks a lot for your answer. Actually, I've tried to use setLock() before and I succeeded in calling it via trusted folder level script. However, I don't know how to instantiate a Lock object. How should I declare a lock object in Javascript, if I don't get it through getLock()? I tried to create a normal Javascript object and set the corresponding properties, but setLock() rejected this object.
-- Quoted Answer
It returns null because there are no lock properties associated with the field. The "setLock()" function needs to be called first. Unfortunately "setLock()" is a privileged funtion, you're not going to be able to call it directly from the VB script.
One way to get around this problem is to place all code for creating and setting up the signature field into a trusted function in a folder level script. Then call the trusted function from the VB app.
var myLock = {action:"Include",fields:["myfld1","myfld2"]};
You can see an example of the lock object by setting up the lock properties manually and then calling "getLock()" from the JavaScript Console.
this.getField("mySig").getLock().toSource();
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script