Results 1 to 5 of 5

Thread: Printing

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2004
    Posts
    49

    Printing

    How do I go about printing the contents of a mshflexgrid?

  2. #2
    Lively Member
    Join Date
    Aug 2003
    Location
    Philadelphia, Pa.
    Posts
    123
    You have to use nested loops for the rows and cols, the .textmatrix property to read the cell contents.

  3. #3

    Thread Starter
    Member
    Join Date
    Oct 2004
    Posts
    49
    can you post an example pls? ive never used this before..

  4. #4
    Lively Member
    Join Date
    Aug 2003
    Location
    Philadelphia, Pa.
    Posts
    123
    This should get you started.

    VB Code:
    1. dim C as Long
    2. dim R as Long
    3. dim str as String
    4.  
    5.     For R = 0 to Grid.Rows -1
    6.  
    7.         For C = 0 to Grid.Cols -1
    8.            
    9.             str = str &  Grid.TextMatrix(R, C) & vbtab
    10.  
    11.         Next C
    12.        
    13.         Printer.Print str
    14.         str = ""
    15.  
    16.     Next R

  5. #5
    Software Eng. Megatron's Avatar
    Join Date
    Mar 1999
    Location
    Canada
    Posts
    11,286
    Make sure you invoke the EndDoc method to commence printing

    Printer.EndDoc

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