Through an amount of brute-force & ignorance I have solved my first problem and I can now reference all the files attached to my document and extract the file names. I can even take one of those files and attach it to my outbound email message. What I can't yet do it to is get the extractFile method to accept a variable name so that I can process it in a loop.
if (document1.getAttachmentList("Body").isEmpty()){
attachmentNames = "No Files Yet";
} else {
var v = document1.getAttachmentList("Body");
for (i=0; i < v.length; i++){
var eo:NotesEmbeddedObject = v.get(i);
attachmentNames = attachmentNames + eo.getName();
var att1:NotesEmbeddedObject = courseDoc.getAttachment(eo.getName());
filepath$ = "d:\\temp\\xsp\\" + attachmentNames;
att1.extractFile(filepath$); <======= if I use a var here it doesn't work, if I code the name explicitly it works fine
sessionScope.put("att"+i,eo.getName());
}
}
Generates the error Script interpreter error, line=15, col=6: [TypeError] Exception occurred calling method NotesEmbeddedObject.extractFile(string) null
I've tried various ways to build the variable but no luck yet. Any clues????