I have the below code in Desiger 10 and it works for the first one or two attachments but then will error out with the following error:
Unhandled exception at 0x5CFCF19A (EScript.api) in Acrobat.exe: 0xC0000005: Access violation reading location 0x80000000.
Code:
var myDoc = event.target;
var attachments = myDoc.dataObjects;
if (attachments == null) {
app.alert("No attachments found!");
} else {
for (var i = 0; i < attachments.length; i++) {
var attach = myDoc.openDataObject(attachments[i].name);
try {
if (attach != null) {
var field = oAttach.getField("myfield");
console.println("field: "+field.value);
attach.closeDoc();
}
} catch (error) {
console.println(error);
}
}
}
console.println("Done loading attachments");
Once this works, there is more code to add.
Help!
Solved! Go to Solution.
Views
Replies
Total Likes
The following seems to have fixed:
...
for (var i = 0; i < attachments.length; i++) {
var attach = myDoc.openDataObject(attachments[i].name);
try {
if (attach != null) {
var field = oAttach.getField("myfield");
console.println("field: "+field.value);
xfa.event.cancelAction = true;
if (attach.disclosed) {
attach.closeDoc();
}
}
} catch (error) {
console.println(error);
}
}
...
Views
Replies
Total Likes
The following seems to have fixed:
...
for (var i = 0; i < attachments.length; i++) {
var attach = myDoc.openDataObject(attachments[i].name);
try {
if (attach != null) {
var field = oAttach.getField("myfield");
console.println("field: "+field.value);
xfa.event.cancelAction = true;
if (attach.disclosed) {
attach.closeDoc();
}
}
} catch (error) {
console.println(error);
}
}
...
Views
Replies
Total Likes
Views
Likes
Replies