Results 1 to 3 of 3

Thread: Printing a RTF file to a given Printer on server-side

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2001
    Posts
    2

    Post Printing a RTF file to a given Printer on server-side

    I have to create a active x dll to be called from a VB exe as well ASP. This dll will be registered on a Win NT server. The VB exe will run as a scheduled process without user interaction whereas the ASP interface will accept user input. But both use the same component.

    My first question is whether it is advisable to use the same component for the exe as well as the ASP file.

    Second:
    What the component should do is - retrieve values from a database, open an rtf file (contains a letter) insert the data in place of some tags in the letter and then print it to the default printer on the server or the printer specified by the user. I thought of using the FileSystemObject. But this does not provide a replace method. Also how can i print this file to the default printer or one specified by the user?

  2. #2
    jim mcnamara
    Guest
    Second question -

    Assuming you want to code in VB, and since you're asking several really complex questions -

    Try:
    Get into Microsoft Word.

    Turn on Macro recording.

    Open the document, mnake the replacement, then print it.

    Turn off recording

    The macro is written in VB, and will give you a very solid starting point for your code. The only downside is that wherever you want the code to run, Word must be installed there on that machine.

    First question -

    I don't know what's advisable. As a rule of thumb: If you can make a single component do it all, you will be better off later on when requirements change and you have to mess with your code again.

  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2001
    Posts
    2
    I started with Word at first but encountered a few problems. Then i came across an article in the Microsoft site as to why Word automation is not recommended on the server -side, that i decided to look at RTF files as an alternative.

    You could check it at:

    http://support.microsoft.com/support.../Q257/7/57.asp

Posting Permissions

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



Click Here to Expand Forum to Full Width