CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2012

    Reading from CSV and Printing

    First off, wanted to introduce myself since I just registered - Hello! Learned C++ about 10 years ago when I was in high school, and am now finding real life situations to use it in. Although I am extremely rusty and quite limited in my knowledge.
    I am starting to think I am over my head in what I originally thought was a easy enough program to create.

    This is what I am trying to accomplish:
    I am trying to create something that takes the file name from an Excel file, locates that file, then sends it to be printed.

    First step was to see how difficult it was to read Excel files. Turns out, parsing XML and stuffs is not what I had in mind. Fortunately, saving as a CSV will work for my purposes.
    My next step was to research what all was involved in making a document print. I have never tried this task before. From the articles and things I am reading, it seems to be quite a burden to code. Especially if it is a WinAPI.

    My main question - Is there something generic already out there that I can just pass a file location as a string, and it prints the file? The file type will always be a PDF.

    Thanks in advance for any and all help on this!

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Hanover Germany

    Re: Reading from CSV and Printing

    Have a look at Excel Automation
    Victor Nijegorodov

  3. #3
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003

    Re: Reading from CSV and Printing

    Look at ShellExecute. You can use the file's associated app to print. I don't think I'd try to mess with reading and rendering PDF files.

  4. #4
    Join Date
    Mar 2012

    Re: Reading from CSV and Printing

    Thanks for the quick responses! Shell execute seems to be the best bet for this application. I can actually just create a macro in excel and skip coding a program to do it with that function.
    Good to know about the use of Automation for future endeavors.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.