I am not at my windows computer right now, so I may be wrong, but I would
try a variant:
dim rect(0 to 3) as Variant
rect(0) = 0
rect(1) = 100
rect(2) = 200
rect(3) = 300
However, if you are passing information to your own function, you can just
rewrite your function to take four numbers instead of an array.
Thank you Karl. I'll try it both ways and let you know what I find.
I tried typing the array as a variant (in the VBA code), but the JS script didn't like that either.
I then changed the JS script to this:
function myAdd417Barcode(n1, n2, n3, n4)
var bcCoords = [n1, n2, n3, n4];
and passed it 4 integers thinking it would accept them in a way that I could then define the rectangle coordinates as shown above. It didn't work, and the error I get is that myCoords (in the script below) "isn't defined".
var InsertPDF417Barcode = app.trustedFunction( function(doc, mycoords)
var bcIconFileName = "/C/Temp/bcTmpImage.pdf";
//var bcCoords = [324, 756, 540, 720];
var t = doc.addField("bcFormID", "button", 0, myCoords);
t.display = display.visible;
t.buttonPosition = position.iconOnly;
t.buttonScaleHow = scaleHow.proportional;
t.buttonScaleWhen = scaleWhen.always;
t.buttonFitBounds = true;
var x = doc.importIcon("myIcon", bcIconFileName, 0);
var f = doc.getField("bcFormID");
var i = doc.getIcon("myIcon")
var y = f.buttonSetIcon(i);
Any suggestions will be appreciated.
It's quite right, myCoords isn't defined. mycoords is, however.
Did you try converting it to a function call ?
Dim v as Variant
v = jso.myAdd417Barcode(rec1,rec2,rec3,rec4)
Thanks! Sometimes I can't see the forest for the trees.