Windows API - Printing Rich Text in VFP 
Author Message
 Windows API - Printing Rich Text in VFP

Hello,

I'm trying to print rich text using the windows API.  But, I have three
problems.  First, for some reason I can't seem to enable the option to allow
the user to select what pages they would like to print From and To.  It just
prints all pages and the From / To is grayed out.  Second, I am trying to find
a way to print a block of text on say page 3 and then start at the top of page
3 again and print another block of text.  Finally, is there anyway to allow the
user to preview the document?  Here's what some of the code looks like:

DECLARE INTEGER StartDoc  IN Win32Api INTEGER, STRING
DECLARE INTEGER StartPage IN Win32Api INTEGER
DECLARE INTEGER EndPage   IN Win32Api INTEGER
DECLARE INTEGER EndDoc    IN Win32Api INTEGER
DECLARE INTEGER CreateDC  IN Win32Api STRING, STRING, INTEGER, INTEGER
DECLARE INTEGER DeleteDC  IN Win32Api INTEGER

with thisform
        .Comdlg.Flags = 256

        *       Trap Errors
        on error m.llErrFlag = .t.

        *       Show the printer dialog
        .Comdlg.PrinterDefault = .t.
        .Comdlg.ShowPrinter()
        if .Comdlg.hDC > 0
                StartDoc(.Comdlg.hDC, "rich text print out")
                m.lnPages = .txControl.CurrentPages
                for m.lnPrint = 1 to m.lnPages
                        StartPage(.Comdlg.hDC)
                        .txControl1.txControl.PrintDevice = .Comdlg.hDC
                        .txControl1.txControl.PrintPage(m.lnPrint)
                        EndPage(.Comdlg.hDC)
                endfor
        endif
endwith

EndDoc(.Comdlg.hDC)
DeleteDC(.Comdlg.hDC)

Mike



Fri, 30 Jan 2004 04:15:54 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Windows API Question and Rich Text

2. Rich Text Nightmare (merging two rich text files)

3. Printing Rich Text Format in VFP

4. VFP 5.0 - How to print rich-text

5. Rich Text Format Printing Problem

6. Rich Text Editing & printing

7. Rich Text Format Print Problem

8. Rich Text Printing

9. Rich Text Format Printing

10. Printing Rich Text

11. How to print a Rich Text ???

12. How to print Rich Text ???

 

 
Powered by phpBB® Forum Software