Thread: Printing documents through word

  1. #1
    Registered User
    Join Date
    Sep 2001
    Location
    England
    Posts
    121

    Printing documents through word

    I have a program which connects to a database for a company, and it needs to be able to print invoices etc. I would like to be able to design the template for the invoices and other documents it will produce in MS word, and have the program add the data from the database to the document, and then print it. I've seen programs that use word in this way before, and it might also allow the user to modify the template easily themselves without inventing my own word processor. It doesnt have to be word, but if not it needs to be free software to distribute with my app.

    The alternative is designing all my documents using GDI code, which would be very time consuming and impossible to edit by the user.

    Any advice or other alternatives are appreciated.

    ps Sorry for posting twice, I accidentally put my first post on the c++ board, so I've had to repost it here.

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Yup I have done this for my access database in work....but I ended up using VBA and it was pretty easy.........if this is any help I will try post a bit of code

  3. #3
    Registered User
    Join Date
    Sep 2001
    Location
    England
    Posts
    121
    Yeah thanks fordy. I assume that's using automation, been reading about that in my biig MFC book last night. Did you have to use VB for the whole app or just the automation client part, because I'm already half way in C++ and I dont want to have to remake the program. If you could post some code that'd be great.

  4. #4
    Registered User
    Join Date
    Sep 2001
    Location
    England
    Posts
    121
    I've started reading up on automation in C/C++ using MFC, although I've found some documentation on doing it in VB too, but I'm still not clear whether I can include VB code for the automation client part of my program and C++ for the rest, and still access all of my C++ variables and/or recordsets. I'd like to use VB if possible, the code for automation seems a lot easier and shorter, although I've no experience in it. If anyone knows anything about mixing languages in this way I'd be glad to hear it, I'm using VS.NET too if that helps

    By the way Fordy have you got that code handy? Sorry to push but I'm on a tight deadline, just wanted to know whether to wait for your code and work on something else (there's plenty to do) or start learning and writing this myself.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Reading Microsoft Word documents
    By Mavix in forum C# Programming
    Replies: 8
    Last Post: 08-04-2007, 07:39 AM
  2. brace-enclosed error
    By jdc18 in forum C++ Programming
    Replies: 53
    Last Post: 05-03-2007, 05:49 PM
  3. Wrong Output
    By egomaster69 in forum C Programming
    Replies: 7
    Last Post: 01-28-2005, 06:44 PM
  4. Printing via word
    By Robert602 in forum C++ Programming
    Replies: 0
    Last Post: 04-16-2002, 02:11 PM