Ping the VB (or something) gurus.

Discussion in 'UK Motorcycles' started by Krusty, Apr 16, 2009.

  1. Krusty

    Krusty Guest

    I've downloaded the source code for a small freebie ActiveX thingy
    which does a mailmerge in Word using an XML file. It uses a form to let
    you enter the XML & .dot file names & locations, & a button to make it
    work its magic. It then creates a separate Word doccie for each record
    in the XML.

    I need it modified to take the filenames as command line input
    parameters & run automatically without opening the form. Ideally I'd
    like a third input parameter to give the option of merging to a single
    document with a separate page for each record, like a traditional merge
    in Word. I.e. I want to be able to do:

    xml2word.exe C:\data\mysourcexml.xml C:\templates\mysourcetemplate.dot
    single|multi

    & it go off & do its stuff without any further input.

    Anyone fancy having a look to see if it's possible?

    --
    Krusty

    '03 Tiger 955i
    '02 MV Senna (for sale) '96 Tiger (for sale)
    '79 Fantic Hiro 250 (for sale) '81 Corvette (for sale)
     
    Krusty, Apr 16, 2009
    #1
    1. Advertisements

  2. Krusty

    Pete Fisher Guest

    Can't see why not bearing in mind this if you are definitely talking VB:

    "Unlike C and C++, where Command Line Arguments are passed as an array
    of values to the executable program, in Visual Basic whatever follows
    the name of the executable program in the Run Window is passed as a
    single String value. What that means is that it's possible to pass more
    than one Command Line Argument, but 'parsing' (separating) the arguments
    is your responsibility---Visual Basic will not do it for you."

    Civica do something similar with their 'Wordtool', but use .ini and .cfg
    files read at runtime to stipulate the parameters.




    --

    +-----------------------------------------------------------------+
    | Pete Fisher at Home: |
    | Visit my Home Page : http://www.flarefox.com/Lesbordes |
    | "Do not adjust your mind - there is a fault in the reality" |
    +-----------------------------------------------------------------+
     
    Pete Fisher, Apr 16, 2009
    #2
    1. Advertisements

  3. Krusty

    Eddie Guest

    Krusty wrote:
    It's possible.
     
    Eddie, Apr 16, 2009
    #3
  4. Krusty

    Krusty Guest

    Is that the sound of you volunteering?
    A couple of the files have .vbp & .vbw extensions, so I presume so.


    --
    Krusty

    '03 Tiger 955i
    '02 MV Senna (for sale) '96 Tiger (for sale)
    '79 Fantic Hiro 250 (for sale) '81 Corvette (for sale)
     
    Krusty, Apr 16, 2009
    #4
  5. Krusty

    CT Guest

    It's possible, but I'm not volunteering. I haven't touched VB in
    years, thank ****.

    Seeing as you have an ActiveX control, I think that the best bet would
    be to create a new stand-alone app that takes the command line
    parameters and then passes those to the ActiveX control to use itself.
     
    CT, Apr 16, 2009
    #5
  6. Krusty

    Pete Fisher Guest

    Not really, though I have played about a bit with VB 2008 Express
    edition.

    I much prefer to drive OLE apps like Word from VFP, or if push really
    comes to shove crank up a VBA 'macro'.

    Still not volunteering, but as others have said, it's certainly
    possible.

    --
    +----------------------------------------------------------------+
    | Pete Fisher at Home: |
    | Voxan Roadster Gilera Nordwest * 2 Yamaha WR250Z |
    | Gilera GFR * 2 Moto Morini 2C/375 Morini 350 "Forgotten Error" |
    +----------------------------------------------------------------+
     
    Pete Fisher, Apr 16, 2009
    #6
  7. Krusty

    CT Guest

    Buggroff!

    I am strictly a C++ (and to a lesser extent C#) person. I've never
    used Delphi - Borland's C++ class library was bad enough.
     
    CT, Apr 16, 2009
    #7
  8. Krusty

    ogden Guest

    Load of new-fangled shit. Classes are just structs with ideas above
    their station.
     
    ogden, Apr 16, 2009
    #8
  9. Krusty

    prawn Guest

    An ex-Delphi/Borland C++ monkey writes:

    Worse than MFC, eh?

    :)
     
    prawn, Apr 16, 2009
    #9
  10. Krusty

    CT Guest

    By orders of magnitude.

    IMO, of course. :eek:)
     
    CT, Apr 16, 2009
    #10
  11. Krusty

    CT Guest

    Apart from the Buggroff! bit, I thought it more of a straight bat, but
    hey-ho...
     
    CT, Apr 16, 2009
    #11
  12. Krusty

    Krusty Guest

    Emailed - with a couple of zips attached so let me know if you block
    them.

    --
    Krusty

    '03 Tiger 955i
    '02 MV Senna (for sale) '96 Tiger (for sale)
    '79 Fantic Hiro 250 (for sale) '81 Corvette (for sale)
     
    Krusty, Apr 16, 2009
    #12
  13. Krusty

    Krusty Guest

    Done.

    --
    Krusty

    '03 Tiger 955i
    '02 MV Senna (for sale) '96 Tiger (for sale)
    '79 Fantic Hiro 250 (for sale) '81 Corvette (for sale)
     
    Krusty, Apr 16, 2009
    #13
  14. Krusty

    Krusty Guest

    It's probably one of our ISPs blocking it due to the zips. I've renamed
    the zips to .jpg & tried again to viaopus.

    If that doesn't work, I'm:
    preston
    dot
    kemp
    gmail.com

    --
    Krusty

    '03 Tiger 955i
    '02 MV Senna (for sale) '96 Tiger (for sale)
    '79 Fantic Hiro 250 (for sale) '81 Corvette (for sale)
     
    Krusty, Apr 16, 2009
    #14
  15. Krusty

    Krusty Guest

    Already? Blimey, that was quick!
    Weeellll, there's a shitload of plastering to do, & some tiling, &
    electrics, & foundations to be dug, &... etc. Or you could just email
    it back, & I'll try to break it!

    --
    Krusty

    '03 Tiger 955i
    '02 MV Senna (for sale) '96 Tiger (for sale)
    '79 Fantic Hiro 250 (for sale) '81 Corvette (for sale)
     
    Krusty, Apr 16, 2009
    #15
  16. Krusty

    Pip Luscher Guest

    Right on!
     
    Pip Luscher, Apr 16, 2009
    #16
  17. Krusty

    prawn Guest

    <Contemplates quantity of popcorn required>

    Integer overflow.
     
    prawn, Apr 16, 2009
    #17
  18. Krusty

    serf Guest

    I'll see your integer overflow and raise you a division by zero error.
     
    serf, Apr 16, 2009
    #18
  19. Krusty

    Krusty Guest

    And you'd both be wrong - it works perfectly!

    --
    Krusty

    '03 Tiger 955i
    '02 MV Senna (for sale) '96 Tiger (for sale)
    '79 Fantic Hiro 250 (for sale) '81 Corvette (for sale)
     
    Krusty, Apr 17, 2009
    #19
  20. Krusty

    CT Guest

    See, Rope's a proper good IT consultant!
     
    CT, Apr 17, 2009
    #20
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.