The documentation of this method says:
Note: (Acrobat 8.0) If cPath is specified, this method can only be
executed during batch and console events. See Privileged versus
non-privileged context for details. The event object contains a
discussion of JavaScript events.
But there are other ways of reading in data from an external file, like the util.readFileIntoStream method.
.
Visit my custom-made PDF scripts website: http://try67.blogspot.com
Contact me personally: try6767@gmail.com