#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    1
    Rep Power
    0

    Post Variable Batch Printing


    Hi, I cant find anyhting anywhere. I want to print an agreement between my club and a member at frequent intervals. I can make a Word template, I need to write a function which takes a template name, and a variant array of data, fills in the template, and prints it. My delphi code has all the data, and I want to do this on clicking a button.

    Function Printcontract(Templatename,Stuff:variant array);
    begin
    load template
    scan template for @Vn
    replace with Stuff[n]
    printdoc;
    end;

    Any ideas?
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Location
    Augsburg Germany
    Posts
    12
    Rep Power
    0
    I can't see the question in your post ...
    Searching for the entrypoint, CreateOleObject('Word.Application'); would be the term for searching. On the other hand you might know this and be searching for alternatives, here I would Fast Reports.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2012
    Posts
    151
    Rep Power
    3
    What I have done before is using rich text format for the template. It's easier to handle since you don't need fancy MS Word ActiveX. Put tags inside the template. In your code you need to find these tags and replace them with correct values. Then print it.

IMN logo majestic logo threadwatch logo seochat tools logo