Solved

Treeview printing

Posted on 1998-12-22
13
305 Views
Last Modified: 2010-05-03
Does anybody know if it is possible to print all the treeview nodes as they are displayed,  including anything that is bellow the scroll bar.  In other words produce a report as it appears in the display.   Help would be most welcomed.
0
Comment
Question by:celo
13 Comments
 

Author Comment

by:celo
Comment Utility
Adjusted points to 80
0
 

Author Comment

by:celo
Comment Utility
Edited text of question
0
 
LVL 2

Expert Comment

by:cedricd
Comment Utility
Directly from the form, yes by printing the form but i think it would be better to use a crystal report,
i do it using this method :
i created a table with this field :
arbor : = R (for root), R1 R2 R3 ... (for a label on the first level) ; R11 R12 R21 R22 (for the label of a second level with R1 or R2 as parent) etc...
label : contain the tree text
level : contain the level
place : contain the place on the treeview (1,2,3,4,5...)

make a sql query ordering by place
on the crystal report make a group footer and a group header for the level field and change the layout as you want.
if it doesn't work with the level field then try with the arbor field.
0
 

Author Comment

by:celo
Comment Utility
Cedricd, thanks for your answer to my question.

I am aware I can print the form but that will not print all the tree if it has scroll bars and its quiet lengthy.    Using crystal reports sounds like a solution by I was looking at printing the treeview object directly to the printer by either placing it on the clipboard or using someother means.
0
 
LVL 7

Expert Comment

by:Inteqam
Comment Utility
tried to build your own function to DRAW the tree in the clipboard or in a text file?

0
 
LVL 2

Expert Comment

by:cedricd
Comment Utility
here is the code i make to fill in the treeview and fill in the table (after that you will be able to do what you want with it : i think that clipboard solution will harder than with crystal report if you want more explanation about crystal report, ask me).

init the treeview from the table

Sub Init_TRListe(fenetre As Form, tree As TreeView, rs As Recordset)
   
    Dim Save_Key As Integer
    Dim taille, last_level As Integer
    Dim last, last_father As String
   
    With tree
         .LineStyle = tvwRootLines
         .BorderStyle = ccFixedSingle
         .Appearance = cc3D
         .MousePointer = ccDefault
         .ToolTipText = Replace(Select_Caption("Arborescence de l$offre"), "$", "'")
    End With
    last_father = "R"
    last_level = 0
    tree.Nodes.Add , tvwFirst, last_father, Select_Caption("Offre")
   
    If Not rs.EOF Then
       rs.MoveFirst
       While Not rs.EOF
          If Val(rs!Level) > last_level Then
             tree.Nodes.Add last_father, tvwChild, rs!Arbor, rs!Arbor + " - " + rs("L" + Trim(rs!Level))
             last_level = Val(rs!Level)
             last_father = rs!Arbor
          Else
             If Val(rs!Level) <= last_level Then
                cpt = 0
                posi = InStr(1, last_father, ".")
                While posi <> 0 And cpt < Val(rs!Level)
                      cpt = cpt + 1
                      lasts = posi
                      posi = InStr(lasts + 1, last_father, ".")
                Wend
                last_father = Left(last_father, lasts - 1)
                tree.Nodes.Add last_father, tvwChild, rs!Arbor, rs!Arbor + " - " + rs("L" + Trim(rs!Level))
                last_level = rs!Level
                last_father = rs!Arbor
             End If
          End If
          rs.MoveNext
       Wend
      'rs.Close
       With tree
          For i = 1 To .Nodes.Count
              .Nodes(i).EnsureVisible
          Next
          .HideSelection = False
          .LabelEdit = tvwAutomatic
          .Refresh
       End With
       fenetre.Refresh
    End If
   
End Sub

Adding a nodes to the treeview (level limited at 5)

Sub Update_Tree(tree As TreeView, father As String, Code As String, Id As String)
    Dim rs As Recordset
    Dim dernier, last_level As Integer
    Dim last As String
    Dim cle As String
   
    dernier = 1
    While tree.Nodes.Item(dernier).Key <> father
          dernier = dernier + 1
    Wend
    place = Find_Place(father, Id) + 1
    If tree.Nodes.Item(dernier).Children > 0 Then
       last = tree.Nodes.Item(dernier).Child.LastSibling.Key
       posi = InStr(1, last, ".")
       While posi <> 0
             posa = posi
             posi = InStr(posi + 1, last, ".")
       Wend
       last = Left(last, posa) + Trim(Str(Val(Right(last, Len(last) - posa)) + 1))
    Else
       last = father + ".1"
    End If
    tree.Nodes.Add father, tvwChild, last, last + " - " + Code
    last_level = 0
    dernier = InStr(1, last, ".")
    While dernier <> 0
          last_level = last_level + 1
          dernier = InStr(dernier + 1, last, ".")
    Wend
    tree.Refresh
    dernier = place - 1
    If last_level < 6 Then
       cle = Update_Entete(Code, Id, Str(last_level))
       Set rs = db.OpenRecordset("Select * from " + ENTTE + " Where offre = '" + Id + "' order by place", dbOpenDynaset)
       rs.FindFirst ("place = " + Str(place))
       If Not rs.NoMatch Then
              While Not rs.EOF
                    rs.Edit
                    rs!place = rs!place + 1
                    rs.Update
                    rs.MoveNext
              Wend
       End If
       rs.Close
       Set rs = db.OpenRecordset("Select * from " + ENTTE + " where entetes = " + cle, dbOpenDynaset)
       rs.Edit
       rs!Arbor = last
       rs!place = place
       rs.Update
       rs.Close
    Else
       rc = MsgBox(Replace(Select_Caption("Vous ne pouvez plus ajouter d$en-tjtes !"), "$", "'"), vbInformation)
       dernier = 1
       While tree.Nodes.Item(dernier).Key <> last
             dernier = dernier + 1
       Wend
       tree.Nodes.Remove (dernier)
    End If
End Sub

Adding to the table

Function Update_Entete(Entetes As String, Id As String, Level As String) As String
    Dim rs As Recordset
    Dim cle As String
   
    On Error GoTo Err_UpdateEnt
    Set rs = db.OpenRecordset("Select * from " + ENTTE + " order by entetes", dbOpenDynaset, 0, dbPessimistic)
    If Not rs.EOF Then
       rs.MoveLast
       cle = rs!Entetes + 1
       rs.FindFirst "offre = '" + Id + "'"
    Else
       Level = "1"
       cle = 1
    End If
    rs.AddNew
    rs!Entetes = cle
    rs!Level = Trim(Level)
    rs("l" + Trim(Level)) = Entetes
    rs!offre = Id
    rs.Update
    rs.Close
    Update_Entete = cle
    Exit Function
Err_UpdateEnt:
    rc = MsgBox(Err.Description, vbCritical)
    On Error Resume Next
    rs.Close
    Update_Entete = ""
End Function


delete a node

    If Not Error Then
       If TreeView1.SelectedItem.Children = 0 And TreeView1.SelectedItem.Key <> "R" Then
          rc = MsgBox(Select_Caption("Attention, toutes les lignes correspondant ` cet en-tjte seront supprimies !"), vbOKCancel)
          If rc = vbOK Then
             Call Supp_Entetes(TreeView1, TreeView1.SelectedItem.Key, Id.Text)
             TreeView1.Nodes.Remove (1)
             Set rs = db.OpenRecordset("Select * from " + ENTTE + " Where offre = '" + Id.Text + "' order by place", dbOpenDynaset)
             Call ReArbor(Id.Text)
             Call Init_TRListe(Me, TreeView1, rs)
             rs.Close
             rc = MsgBox(Select_Caption("En-tjte supprimi !"), vbInformation)
          End If
       Else
          If TreeView1.SelectedItem.Key <> "R" Then
             rc = MsgBox(Replace(Select_Caption("Vous devez d$abord supprimer les sous en-tjtes !"), "$", "'"), vbInformation)
          End If
       End If
    End If


Sub ReArbor(Id As String)
    Dim rs As Recordset
    Dim Save_Key() As Integer
    Dim taille, last_level As Integer
    Dim last, last_father As String
   
    last = "R"
    last_level = 0
    taille = last_level + 1
    ReDim Save_Key(taille)
    Save_Key(taille) = 0
    Set rs = db.OpenRecordset("Select * from " + ENTTE + " Where offre = '" + Id + "' order by place", dbOpenDynaset)
    If Not rs.EOF Then
       rs.MoveFirst
       While Not rs.EOF
             Select Case Val(rs!Level)
                    Case Is = last_level
                         Save_Key(last_level) = Save_Key(last_level) + 1
                         last = last_father + "." + Trim(Str(Save_Key(last_level)))
                    Case Is > last_level
                         last_level = Val(rs!Level)
                         If last_level > taille Then
                            taille = last_level
                            ReDim Preserve Save_Key(taille)
                         End If
                         Save_Key(last_level) = 1
                         last_father = last
                         last = last_father + "." + Trim(Str(Save_Key(last_level)))
                    Case Is < last_level
                         cpt = 0
                         posi = InStr(1, last_father, ".")
                         While posi <> 0 And cpt < Val(rs!Level)
                               posa = posi
                               cpt = cpt + 1
                               posi = InStr(posi + 1, last_father, ".")
                         Wend
                         last_father = Left(last_father, posa - 1)
                         last_level = rs!Level
                         Save_Key(last_level) = Save_Key(last_level) + 1
                         last = last_father + "." + Trim(Save_Key(last_level))
             End Select
             With rs
                  .Edit
                  !Arbor = last
                  .Update
                  .MoveNext
             End With
       Wend
    End If
    rs.Close
End Sub

after that you can make a crystal report with this table
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 2

Expert Comment

by:cedricd
Comment Utility
here is the code i make to fill in the treeview and fill in the table (after that you will be able to do what you want with it : i think that clipboard solution will harder than with crystal report if you want more explanation about crystal report, ask me).

init the treeview from the table

Sub Init_TRListe(fenetre As Form, tree As TreeView, rs As Recordset)
   
    Dim Save_Key As Integer
    Dim taille, last_level As Integer
    Dim last, last_father As String
   
    With tree
         .LineStyle = tvwRootLines
         .BorderStyle = ccFixedSingle
         .Appearance = cc3D
         .MousePointer = ccDefault
         .ToolTipText = Replace(Select_Caption("Arborescence de l$offre"), "$", "'")
    End With
    last_father = "R"
    last_level = 0
    tree.Nodes.Add , tvwFirst, last_father, Select_Caption("Offre")
   
    If Not rs.EOF Then
       rs.MoveFirst
       While Not rs.EOF
          If Val(rs!Level) > last_level Then
             tree.Nodes.Add last_father, tvwChild, rs!Arbor, rs!Arbor + " - " + rs("L" + Trim(rs!Level))
             last_level = Val(rs!Level)
             last_father = rs!Arbor
          Else
             If Val(rs!Level) <= last_level Then
                cpt = 0
                posi = InStr(1, last_father, ".")
                While posi <> 0 And cpt < Val(rs!Level)
                      cpt = cpt + 1
                      lasts = posi
                      posi = InStr(lasts + 1, last_father, ".")
                Wend
                last_father = Left(last_father, lasts - 1)
                tree.Nodes.Add last_father, tvwChild, rs!Arbor, rs!Arbor + " - " + rs("L" + Trim(rs!Level))
                last_level = rs!Level
                last_father = rs!Arbor
             End If
          End If
          rs.MoveNext
       Wend
      'rs.Close
       With tree
          For i = 1 To .Nodes.Count
              .Nodes(i).EnsureVisible
          Next
          .HideSelection = False
          .LabelEdit = tvwAutomatic
          .Refresh
       End With
       fenetre.Refresh
    End If
   
End Sub

Adding a nodes to the treeview (level limited at 5)

Sub Update_Tree(tree As TreeView, father As String, Code As String, Id As String)
    Dim rs As Recordset
    Dim dernier, last_level As Integer
    Dim last As String
    Dim cle As String
   
    dernier = 1
    While tree.Nodes.Item(dernier).Key <> father
          dernier = dernier + 1
    Wend
    place = Find_Place(father, Id) + 1
    If tree.Nodes.Item(dernier).Children > 0 Then
       last = tree.Nodes.Item(dernier).Child.LastSibling.Key
       posi = InStr(1, last, ".")
       While posi <> 0
             posa = posi
             posi = InStr(posi + 1, last, ".")
       Wend
       last = Left(last, posa) + Trim(Str(Val(Right(last, Len(last) - posa)) + 1))
    Else
       last = father + ".1"
    End If
    tree.Nodes.Add father, tvwChild, last, last + " - " + Code
    last_level = 0
    dernier = InStr(1, last, ".")
    While dernier <> 0
          last_level = last_level + 1
          dernier = InStr(dernier + 1, last, ".")
    Wend
    tree.Refresh
    dernier = place - 1
    If last_level < 6 Then
       cle = Update_Entete(Code, Id, Str(last_level))
       Set rs = db.OpenRecordset("Select * from " + ENTTE + " Where offre = '" + Id + "' order by place", dbOpenDynaset)
       rs.FindFirst ("place = " + Str(place))
       If Not rs.NoMatch Then
              While Not rs.EOF
                    rs.Edit
                    rs!place = rs!place + 1
                    rs.Update
                    rs.MoveNext
              Wend
       End If
       rs.Close
       Set rs = db.OpenRecordset("Select * from " + ENTTE + " where entetes = " + cle, dbOpenDynaset)
       rs.Edit
       rs!Arbor = last
       rs!place = place
       rs.Update
       rs.Close
    Else
       rc = MsgBox(Replace(Select_Caption("Vous ne pouvez plus ajouter d$en-tjtes !"), "$", "'"), vbInformation)
       dernier = 1
       While tree.Nodes.Item(dernier).Key <> last
             dernier = dernier + 1
       Wend
       tree.Nodes.Remove (dernier)
    End If
End Sub

Adding to the table

Function Update_Entete(Entetes As String, Id As String, Level As String) As String
    Dim rs As Recordset
    Dim cle As String
   
    On Error GoTo Err_UpdateEnt
    Set rs = db.OpenRecordset("Select * from " + ENTTE + " order by entetes", dbOpenDynaset, 0, dbPessimistic)
    If Not rs.EOF Then
       rs.MoveLast
       cle = rs!Entetes + 1
       rs.FindFirst "offre = '" + Id + "'"
    Else
       Level = "1"
       cle = 1
    End If
    rs.AddNew
    rs!Entetes = cle
    rs!Level = Trim(Level)
    rs("l" + Trim(Level)) = Entetes
    rs!offre = Id
    rs.Update
    rs.Close
    Update_Entete = cle
    Exit Function
Err_UpdateEnt:
    rc = MsgBox(Err.Description, vbCritical)
    On Error Resume Next
    rs.Close
    Update_Entete = ""
End Function


delete a node

    If Not Error Then
       If TreeView1.SelectedItem.Children = 0 And TreeView1.SelectedItem.Key <> "R" Then
          rc = MsgBox(Select_Caption("Attention, toutes les lignes correspondant ` cet en-tjte seront supprimies !"), vbOKCancel)
          If rc = vbOK Then
             Call Supp_Entetes(TreeView1, TreeView1.SelectedItem.Key, Id.Text)
             TreeView1.Nodes.Remove (1)
             Set rs = db.OpenRecordset("Select * from " + ENTTE + " Where offre = '" + Id.Text + "' order by place", dbOpenDynaset)
             Call ReArbor(Id.Text)
             Call Init_TRListe(Me, TreeView1, rs)
             rs.Close
             rc = MsgBox(Select_Caption("En-tjte supprimi !"), vbInformation)
          End If
       Else
          If TreeView1.SelectedItem.Key <> "R" Then
             rc = MsgBox(Replace(Select_Caption("Vous devez d$abord supprimer les sous en-tjtes !"), "$", "'"), vbInformation)
          End If
       End If
    End If


Sub ReArbor(Id As String)
    Dim rs As Recordset
    Dim Save_Key() As Integer
    Dim taille, last_level As Integer
    Dim last, last_father As String
   
    last = "R"
    last_level = 0
    taille = last_level + 1
    ReDim Save_Key(taille)
    Save_Key(taille) = 0
    Set rs = db.OpenRecordset("Select * from " + ENTTE + " Where offre = '" + Id + "' order by place", dbOpenDynaset)
    If Not rs.EOF Then
       rs.MoveFirst
       While Not rs.EOF
             Select Case Val(rs!Level)
                    Case Is = last_level
                         Save_Key(last_level) = Save_Key(last_level) + 1
                         last = last_father + "." + Trim(Str(Save_Key(last_level)))
                    Case Is > last_level
                         last_level = Val(rs!Level)
                         If last_level > taille Then
                            taille = last_level
                            ReDim Preserve Save_Key(taille)
                         End If
                         Save_Key(last_level) = 1
                         last_father = last
                         last = last_father + "." + Trim(Str(Save_Key(last_level)))
                    Case Is < last_level
                         cpt = 0
                         posi = InStr(1, last_father, ".")
                         While posi <> 0 And cpt < Val(rs!Level)
                               posa = posi
                               cpt = cpt + 1
                               posi = InStr(posi + 1, last_father, ".")
                         Wend
                         last_father = Left(last_father, posa - 1)
                         last_level = rs!Level
                         Save_Key(last_level) = Save_Key(last_level) + 1
                         last = last_father + "." + Trim(Save_Key(last_level))
             End Select
             With rs
                  .Edit
                  !Arbor = last
                  .Update
                  .MoveNext
             End With
       Wend
    End If
    rs.Close
End Sub

after that you can make a crystal report with this table
0
 

Author Comment

by:celo
Comment Utility
Cedricd thanks for the code, it looks involved but I will try it,  If its not much trouble, I wouldnt mind some info on the crystal report formating.


Thanks

0
 
LVL 2

Expert Comment

by:cedricd
Comment Utility
there's two solution to make a crystal report,
first using the program crystal report (in vb's menu, click on add-ins,report designer)
or by the code :

put a crystal control on your form and a button (or a menu) to print the crystal report
link the crystal control to a data control.
link the data control to your database and data control.recordsource = sql (select * from table in example).
call the following function with this parameter :

tree_report.rpt,sql,crystal1,crptTofile
(reportsource = datacontrol)
after, open the report created and change the lay-out

print the report to a printer (change the last parameter : crpttowindows for a preview or crpttoprinter to print directly on the printer).
(report source =crptreport)

Function Print_Report(Fichier As String, sql As String, Crystal As Control, dest As Integer) As Boolean
       Crystal.SQLQuery = sql
       Crystal.ReportSource = crptReport
       Crystal.PrintFileType = crptCrystal
       Crystal.PrintFileName = App.Path + "\Reports\" + Fichier
       Crystal.ReportFileName = App.Path + "\Reports\" + Fichier
       Crystal.Destination = dest
       Crystal.PrintReport
       Crystal.SQLQuery = ""
       Print_Report = True
End Function

0
 

Author Comment

by:celo
Comment Utility
Thanks for you help, but there must be a way of doing a treeview print in some way.  I will leave the question open and see if I can get some solution other then writting the data to a table and them simulating the print in Crystal.  Many thanks
0
 
LVL 1

Expert Comment

by:bear454
Comment Utility
How about formatting the tree into HTML ?
See www.salesforceone.com/tzone/Websales/ for an example.
If this is what your looking for, I can help you with the code.
0
 

Author Comment

by:celo
Comment Utility
Bear454,
I had a look at www.salesforceone.com/tzone/Websales and printed the tree which was bigger then the screen size and all of the tree as printed. This is exactly what I want to achieve.  Will it be easy to format the tree in HTML without much change VB, my knowledge of HTML is very basic.  Please if possible guide me through the process and provide me with the code required.  

Thanking you for your help


0
 
LVL 14

Accepted Solution

by:
waty earned 80 total points
Comment Utility
' #VBIDEUtils#************************************************************
' * Programmer Name  : Waty Thierry
' * Web Site         : www.geocities.com/ResearchTriangle/6311/
' * E-Mail           : waty.thierry@usa.net
' * Date             : 21/01/99
' * Time             : 08:47
' * Module Name      : Treeview_Module
' * Module Filename  : Treview.bas
' **********************************************************************
' * Comments         : Print a Treeview
' *
' *
' **********************************************************************

Option Explicit

Public Const INDENT_WIDTH = 300
Public Const ITEM_HEIGTH = 300

Private Const MAX_INDENT = 10
Private bBoudin(0 To MAX_INDENT) As Boolean

Public Sub PrintTreeview(ByRef tv As TreeView, prt As Object)
   ' #VBIDEUtils#************************************************************
   ' * Programmer Name  : Waty Thierry
   ' * Web Site         : www.geocities.com/ResearchTriangle/6311/
   ' * E-Mail           : waty.thierry@usa.net
   ' * Date             : 21/01/99
   ' * Time             : 08:48
   ' * Module Name      : Module1
   ' * Module Filename  :
   ' * Procedure Name   : PrintTreeview
   ' * Parameters       :
   ' *                    ByRef tv As TreeView
   ' *                    prt As Object
   ' **********************************************************************
   ' * Comments         : Print a treeview
   ' *
   ' *
   ' **********************************************************************

   Dim i          As Integer
   Dim n          As Node
   
   Debug.Assert (TypeOf prt Is PictureBox) Or (TypeOf prt Is Printer)
   
   Set n = tv.Nodes(1)
   Do
      PrintTreeviewNode tv, n, 0, prt
     
      If Printer.CurrentY >= Printer.Height - 1000 Then Printer.NewPage
     
      Set n = n.Next
   Loop While Not (n Is Nothing)
   
End Sub

Private Sub PrintTreeviewNode(ByRef tv As TreeView, ByRef nd As Node, ByVal lvl As Integer, ByRef prt As Object)
   ' #VBIDEUtils#************************************************************
   ' * Programmer Name  : Waty Thierry
   ' * Web Site         : www.geocities.com/ResearchTriangle/6311/
   ' * E-Mail           : waty.thierry@usa.net
   ' * Date             : 21/01/99
   ' * Time             : 08:48
   ' * Module Name      : Module1
   ' * Module Filename  :
   ' * Procedure Name   : PrintTreeviewNode
   ' * Parameters       :
   ' *                    ByRef tv As TreeView
   ' *                    ByRef nd As Node
   ' *                    ByVal lvl As Integer
   ' *                    ByRef prt As Object
   ' **********************************************************************
   ' * Comments         : Print the node of a treeview
   ' *
   ' *
   ' **********************************************************************

   Dim i       As Integer
   Dim n       As Node
   Dim x0      As Single
   Dim y0      As Single
   
   x0 = 0
   y0 = prt.CurrentY
   
   ' *** Print boudins
   For i = IIf(tv.LineStyle = tvwRootLines, 0, 1) To lvl - 1
      If bBoudin(i) Then
         prt.Line (x0 + INDENT_WIDTH \ 4, y0)-Step(0, ITEM_HEIGTH), vbBlack
      End If
      x0 = x0 + INDENT_WIDTH
   Next
   
   bBoudin(lvl) = Not (nd.Next Is Nothing)
   
   If tv.LineStyle = tvwRootLines Or lvl > 0 Then
      If nd.Next Is Nothing Then
         prt.Line (x0 + INDENT_WIDTH \ 4, y0)-Step(0, ITEM_HEIGTH \ 2), vbBlack
         prt.Line -Step(INDENT_WIDTH - INDENT_WIDTH \ 4, 0), vbBlack
      Else
         prt.Line (x0 + INDENT_WIDTH \ 4, y0)-Step(0, ITEM_HEIGTH), vbBlack
         prt.CurrentY = prt.CurrentY - ITEM_HEIGTH \ 2
         prt.Line -Step(INDENT_WIDTH - INDENT_WIDTH \ 4, 0), vbBlack
      End If
      x0 = x0 + INDENT_WIDTH
   End If
   
   If Not (tv.ImageList Is Nothing) _
      And (tv.Style And (tvwPictureText Or tvwPlusPictureText Or tvwTreelinesPictureText Or tvwTreelinesPlusMinusPictureText)) Then
      If Len(nd.Image) Then
         prt.PaintPicture tv.ImageList.ListImages.Item(nd.Image).Picture, x0, y0
      End If
      x0 = x0 + INDENT_WIDTH
   End If
   
   prt.CurrentX = x0
   prt.CurrentY = y0
   prt.Print nd.Text
   
   prt.CurrentY = y0 + ITEM_HEIGTH
   
   If TypeOf prt Is Printer Then
      If prt.CurrentY > prt.Height Then
         prt.NewPage
         prt.CurrentY = 0
      End If
   End If
   
   If nd.Children Then
      Set n = nd.Child
      Do
         PrintTreeviewNode tv, n, lvl + 1, prt
         If Printer.CurrentY >= Printer.Height - 1000 Then Printer.NewPage
         Set n = n.Next
      Loop Until n Is Nothing
   End If
   
   
End Sub


0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now