Excel VBA to JS: How does one pass rectangle coordinates to a JS function.

I have an Excel VBA sub that calls a folder level JS function and I'm trying to pass a set of rectangle coordinates.
This is the VBA code:
Sub BarcodeDoc_PDF417(pdfFileName As String)
    Dim AVDoc As Acrobat.CAcroAVDoc
    Dim PDDoc As Acrobat.CAcroPDDoc
    Dim myApp As Acrobat.CAcroApp
    Dim jso As Object
    Dim bcTmpFile As String
        bcTmpFile = "C:\Temp\bcTmpFile.pdf"
        Set myApp = CreateObject("AcroExch.App")
        Set AVDoc = CreateObject("AcroExch.AVDoc")
            If AVDoc.Open(pdfFileName, "") Then
                Set PDDoc = AVDoc.GetPDDoc
                Set jso = PDDoc.GetJSObject
                    jso.myAdd417Barcode 'This is where the coordinates get passed.
                    PDFSave PDDoc, bcTmpFile
                myApp.CloseAllDocs
                myApp.Exit
                Set AVDoc = Nothing
                Set jso = Nothing
                Set PDDoc = Nothing
                Set myApp = Nothing
            Else
                MsgBox "Sub: BarcodeDoc_PDF417. Document not found:" & vbCrLf & vbCrLf & pdfFileName
            End If
End Sub
This is the folder level JS script:
function myAdd417Barcode(myCoords)
//The line below is just for testing. Will come out once I can pass the coords in from my VBA sub.
//var myCoords = [324, 756, 540, 720];
InsertPDF417Barcode(this, myCoords);
I've tried to pass the coords as a string and an array, both to no avail. Any ideas?
Thanks.

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];
  InsertPDF417Barcode(this, bcCoords);
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)
  app.beginPriv();
  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;
  t.setButtonIcon
  var x = doc.importIcon("myIcon", bcIconFileName, 0);
  var f = doc.getField("bcFormID");
  var i = doc.getIcon("myIcon")
  var y = f.buttonSetIcon(i);
  app.endPriv();
Any suggestions will be appreciated.
Thanks!

Similar Messages

  • How does one pass import parameters to a report within a method?

    Hello all,
    Well how does one  pass import parameters to a report which is within a method ...end method.
    for example :
    method 123
    SUBMIT reportname using selection '1000'
    endmethod .
    Here we need to pass values into the selection screen and run the report for those values.
    The values are say 'ABC'   (  tablename "DEF" and field name "HIJ" ).
    I hope the question is clear, awaiting your response 
    Thanks and Regards,
    Sandeep.

    Go to SE24
    Parameters: Give the Parameter name, Typing method is "Type" is the domain type that u are selecting, say for e.g :  Parameter is "P_CONT" , its associated type "CHAR32" etc
    For Select Options:  Parameter name say "S_CUST", Type"importing". For this you need to give an associated type which must be created as "TABLE TYPE " in SE11. That table type needs to have a "LINE TYPE" .
    LINE TYPE is a Structure created with components "SIGN, OPTION, LOW & HIGH" for select-Options.
    NOTE: for a Table type related to Customer data fields "say KUNNR", the line type created must have the Component Type and data Type corresponding to the Data Element associated with "KUNNR" ;i.e: "CHAR" etc.
    See if this is clear to you or revert back in case of any Confusion.

  • How does one pass data between war files

    Hello All,
    I need to be able to pass values between 2 war files.
    example:
    from a JSP file in the 1st war file i get the login information and need to pass
    the userid and password to another JSP in the 2rd war file.
    Question: How does one go about doing this.
    I'm using webLogic server 6.1 on NT.
    Thanks - Bala

    The problem is that web applications do not share the same session by
    default. If you set the cookie name to be the same for both web
    applications, you should be able to pass the data in the HttpSession...
    Bala Ganesh wrote:
    Hello All,
    I need to be able to pass values between 2 war files.
    example:
    from a JSP file in the 1st war file i get the login information and need to pass
    the userid and password to another JSP in the 2rd war file.
    Question: How does one go about doing this.
    I'm using webLogic server 6.1 on NT.
    Thanks - Bala

  • How does one peek at touches without ruining a UIScrollView?

    If you subclass the:
    touchesEnded: withEvent:
    method in a UIScrollView delegate, you will ruin the scrolling. How does one pass this even onto the scroll controller? I now that in a UIWebView you forward the event to the first object, but is there a known trick for handling UIScrollViews?

    To further explain, if I want to note that touches began, and then pass the event onto the scroll handler, how does one do that? Do i pass the event to the "super"? where do I send it?

  • How does one convert pdf to excel

    how does one convert pdf to excel

    Use Acrobat and choose Save As -> Spreadsheet -> Microsoft Excel

  • How does one copy an xygraph from a refnum?

    Sorry, normally this is straight forward enough to push through on my own.
    Purpose:
    Pass Refnum of XY graph to subvi -->
    Subvi's purpose : PRINT XYGRAPH to file/pdf/bmp, manipulate xy graph further (change back ground color to optomize for printing, optomize xy graph size for printing, move legend), perform some simple analysis on the data (rms, pkp etc)
    Problem Statements: 
    1 When using a refnum, writing any changes to the refnums property value will also change the parent i.e. the subvi xygraph.  This is not desired, so an exact copy of the xygraph must be made.  HOW DO YOU DO THIS?
    2 When using a refnum for an xygraph, how does one retrieve the xy values?  If the property node for value is selected, a variant is produced.  (which after careful examination I was still not able to make heads or tales of this particular variant) 
    p.s. A refnum is used because the xygraph already has formatting applied to its legend, plots, axis, etc.  A refnum passed to a subvi is the only way I know to pass all formating etc for the graph.
    p.p.s. I understand that there is an invoke node that will export an image, it contains certain limitations (such as requiring the subvi be opened, since it works by similar rules to a printscrn) that make it un applicable to this problem.
    -Regards
    eximo
    UofL Bioengineering M.S.
    Neuronetrix
    "I had rather be right than be president" -Henry Clay
    Solved!
    Go to Solution.

    eximo wrote:
    Problem Statements: 
    1 When using a refnum, writing any changes to the refnums property value will also change the parent i.e. the subvi xygraph.
    I don't understand this statement. Does the subVI have a graph also? Obviously, if you make changes to properties via the refnum, then the graph it's pointing to will change.
    p.p.s. I understand that there is an invoke node that will export an image, it contains certain limitations (such as requiring the subvi be opened, since it works by similar rules to a printscrn) that make it un applicable to this problem.
    Again, I don't understand. Where's the graph? On the main VI, or the subVI? If it's on the main VI, why would this be an issue? Wouldn't the main VI window be open?

  • How does one upload a file from flex to a cfc

    How does one upload a file from flex to a cfc?   Can you do the file upload via remote object? I usually do uploads cia cfm but prefer the asnc capabilities of remote object calls.

    Hi,
    The issue here is myFile. For flex we need to pass this name as paramenter becuase it's not html form item like:
    <cfcomponent>
        <cffunction name="uploadFile" access="remote" output="false" returntype="void">
        <cfargument name="file" required="Yes" type="any">
            <cffile action="upload" filefield="#arguments.file#" destination="C:\temp\" nameconflict="makeunique">
        </cffunction>
    </cfcomponent>
    From flex I'm getting the file using fileReference like:
    private function browseAndUpload():void
                    fileReference = new FileReference();
                    fileReference.addEventListener(Event.SELECT,fileReference_Select);
                    fileReference.addEventListener(Event.CANCEL,fileReference_Cancel);
                    fileReference.browse();
                private function fileReference_Select(event:Event):void
                    fileReference.addEventListener(ProgressEvent.PROGRESS,fileReference_Progress);
                    fileReference.addEventListener(Event.COMPLETE,fileReference_Complete);
                    fileReference.addEventListener(IOErrorEvent.IO_ERROR,onLoadError);
                    //fileReference.upload(request);
                    fileName = fileReference.name;
                    myFile.htmlText = fileReference.name;
                    SM_RO.importNSA();
    filerReference have an upload method to upload the file but I can't use that becuase I need to process my upload with my cfc.
    I'm getting an error:
    Failed to import the file. The cffile action="upload" requires forms to use enctype="multipart/form-data". Please also make sure the file is not open.
    I can't find the way to setup the enctype becuase again i can have html form items in flex, or I can?
    Thanks
    Johnny

  • How does one create their own interpolation

    I am currently working on a tile-based environment in which the user controls a tank. I have been attempting to use interpolators to smooth out the movement between tiles, but I have had a lot of trouble acheiving the desired effects. From what I have gathered from various posts is that the interpolator classes are only useful for repeating animations (please correct me if this statement is wrong).
    My question then is:
    How does one create their own or methods which simulates the interpolation behavior; I am particularly interested in the PositionInterpolator for translating the missles fired by the tank.
    I attempted to do this several times, but I have failed. Here is one of my attempts:
    public void fire()
         show(); //show the missle geometry
         int TRANSLATION_TIME = 1000; //blast alive for 5 seconds
         float DISTANCE = 20.0f; //missle travels a distance of 20 units
         //interpolate path
         long startTime = System.currentTimeMillis();
         long endTime = startTime +TRANSLATION_TIME;
         long interval = endTime - startTime;
         float translationPercent;
         float lastTransPercent = 0;
         float dist;
         Transform3D translate = new Transform3D();
         while(System.currentTimeMillis() < endTime && !collision)
         interval = System.currentTimeMillis() - startTime;
         translationPercent = (float)interval/TRANSLATION_TIME;
         dist = DISTANCE*(translationPercent - lastTransPercent);
         lastTransPercent = translationPercent;
         translate.setTranslation(new Vector3f(0.0f, 0.0f, -dist));
         interpolate(translate);
    public void interpolate(Transform3D translate)
         Transform3D t3d = new Transform3D();
         missleTG.getTransform(t3d);
         t3d.mul(translate);
         missleTG.setTransform(t3d);     
    What happens using this code is that the missle just waits at its initial location until the TRANSLATION_TIME has passed, and then jumps to the final position -- the missle does not smoothly translate to the final location. Are there any explainations out there for this behaviors.
    -Thanks in advance

    Hi,
    I'm also working on a game environment where the user can move around in a spaceship and fire missiles etc...
    I haven't looked much at interpolators, but I use Behaviors for everything I need to move/rotate/scale...
    You can for example create your own behavior (by extending the Behavior class) and set it up to move the missile when you press a specific key, or when any other kind of event takes place...
    You should check the documentation for the Behavior class.
    Hope this helps...

  • HT1689 How does one sterilise an iPad?

    How does one sterilise an iPad to prevent the possibility of passing on infection; eg. Tummy bug?

    Wipe the screen and case with anti-bac surface wipes? Make sure they are safe to use on aluminium. Be careful around the ports and buttons. You don't want any liquid getting in there.

  • In Pages 5 when I try to attach a pages document to an email it gives me 2 folders and 4 files ???  How does one email a pages document.

    How does one email a pages document? In pages 5 when I try to attach a pages document to a gmail email it gives me 2 folders and 4 other files to choose from. 

    Sounds like you are using Gmail.
    Pages 5 uses a zipped package of files as its format. 3rd party servers don't understand the format and show it as the component parts.
    Use Mail toenail the file or zip the .pages document before sending.
    Peter

  • How does one change the font size for folders and/or file lists in the Bookmarks Library?

    How does one change the font size for folders and/or file lists in the '''Bookmarks''' Library?
    Since the upgrade to version 9.0.1 of Firefox, the Bookmarks feature changes are confusing me. They seem to be confusing themselves as well. The list of bookmarks has changed. The font size is so small that my aging eyes cannot read it without fogging the screen with my breath. Some folders are out of alphabetical order (where I know they were previously good), and some are missing altogether (folders to which I frequently add references).
    As for missing or deranged files or folders, was there something that I should have done or now need to do to recover those after the upgrade (or before)?
    With regard to font size,
    1. there is no “Edit Bookmarks” or like option to edit the list in this version
    2. the “zoom” option in the “view” list of functions is greyed out when in “Show All Bookmarks” window
    3. expanding the browser window has no effect on font size
    4. “Preferences” settings for font size has no effect in that window either, including advanced settings
    5. “Help” offers none that I can find.
    Can any of you Help?!?

    Maybe this extension helps:
    *Theme Font & Size Changer: https://addons.mozilla.org/firefox/addon/theme-font-size-changer/

  • How does one use an external microphone with the internal camera?

    I want to use the internal camera because I don't have anything better but I want to use an external mic to record video and sound simultaneously, for a video blog. How does one accomplish this? I'm getting no help from the manual.

    Try this. Connect your external mic, either through the audio line in port or, into a USB port if it is a USB mic and then go to System Preferences under the Apple and select the Sound icon under Hardware. Click on your mic shown in the list of input devices.
    Hope that works for you.
    Forest

  • In the new Keynote how does one find the Wrap Inspector to wrap text around a photo??? Thanks

    In the new keynote, the help section refers to the Wrap Inspector.  How does one find that or how does one wrap text around a photo??   Thanks

    You can also use the shape tool to draw a shape roughly following the outline of the graphic you want to wrap text around, change the fill and stroke to "none", then paste your text within the shape. It's a few more steps, but it opens you up to many creative alternative layouts.

  • I have a MacAir, mid 2011 model, and want to view video on my TV.  I see that I need a mini display port to Hdmi but there are many of these.  What exatly do I need and how does one view a movie downloaded to the MacAir on a TV screen?

    I have a MacAir, mid 2011 model, and want to view video on my TV.  I see that I need a mini display port to Hdmi but there are many of these.  What exatly do I need and how does one go about viewing a movie downloaded to the MacAir on a TV screen?

    Welcome to Apple Support Communities
    That's exactly what you need. A Mini DisplayPort to HDMI adapter and a HDMI cable. See > http://support.apple.com/kb/HT4241?viewlocale=en_US
    This is the only way to view a video on the TV. After connecting your MacBook Air to the TV, image on your TV should show immediately. Then, press Command and F1 keys to mirror your MacBook Air display, and open the video

  • HT1918 How does one organise the apple ID so that one uses the same email address to have an account on both the UL and Belgian itunes stores?

    I have in the past created an Apple ID for use with the UK itunes store, because I want to read in English.  If I sign in it seems that this ID will only allow me to purchase from the UK store.  But I live in Belgium, so I can't download from the UK store.  So I tried to create an apple ID for the Belgian itunes store.  But I want to use the same email address as I used for the first apple ID I made (because I'm fed up of having to remember which email address I used for which account).  When I tried this, I just get a message saying that the email address is already in use for another account (which I know, because it's me who made that account).  Does anyone have a workaround for this?
    cheers
    Andrew

    I have tried again using the same password. and it still doesn't work.
    I'm presuming you went ahead and set up a new Apple ID, yes? Using the same password in more than one Apple ID has worked for me in the past, but I haven't tried it in a while so the tightened security may have changed that. You could use the same password but add "-UK" and "-BE", or something like that, to make it easier to remember.
    I understand what you mean about losing the ability to deal with UK purchased stuff, but this is becoming so inconvenient that I do want to delete that UK apple ID account.  I have looked everywhere I can think of on the apple website (apple id, itunes, support etc) and I can't find a link/eplanation/contact point that deals with deleting apple ID and itune store accounts.  Surely this must be possible?
    It's possible, but Apple is very reluctant to do it, and it's not something a user can do on their own. It would be better to just stop using the UK account rather than trying to get it deleted. Just remove your payment information and there should be little reason to have the account deleted. If you really want to try, though, you'll need to send a message to iTunes support specifying that you want the account cancelled.
    On a completely different matter, I have bought my son an ipod touch.  But since he is younger than 13 years old, how does one go about using the itunes store to get music onto his ipod touch?
    You would need to buy tracks for him; he's too young to have his own iTunes Store account. To control what gets synched to his iPod, this should help:
    http://support.apple.com/kb/HT1495
    Regards.

Maybe you are looking for

  • Can Time Machine back up an external hard drive plugged into a Time Capsule

    I have iTunes and iPhoto libraries that have outgrown the hard drive on my laptop so I've moved them on to an external hard drive. Since I'd like to move around the house with the laptop, I've plugged the external hard drive in to the Time Capsule so

  • Maximum size for Hard Disk in Lenovo 3000 N100

    I have the Lenovo 3000 N100 it came with 100 GB Hard Disk 5400 RPM What is the maximum Hard Disk that can be used. Can it be of 7200 RPM or only 5400 RPM? Thanks for possible reply Abraham Solved! Go to Solution.

  • Error messages when syncing

    First I don't know if I have a nano or shuffle. Have just updated to itunes9 but am now getting error messages when syncing. Messages are -120 and -124. After I keep clicking to get out of them itunes then tells me that I need to restore and then tel

  • Partitioning an External Drive

    Hi, I'm in the process of switching from my PC setup to my iBook via my external hard drive. I partitioned half the hard drive (200GB) to NTFS and loaded most of my data onto this partition, hoping to hook it up to the iBook, create a new mac paritio

  • 3250 Media 10 Connection

    I have tried connecting my 3250 to win xp sp2 to use with Windows Media Player 10, but when ever I choose this option Windows cannot install this hardware. Does anyone know if the driver is in PC Suite, or do I need to download and install it seperat