Question : How do I change Notepad to print landscape using Access VBA

I need to print out a hardcopy of certian text files (.txt) in landscape.
So I need the VBA code to change the Notepad orientation and sometimes the left and right margins.

Answer : How do I change Notepad to print landscape using Access VBA

Why use Notepad to print text? It seems an Access report offers much better control.

I created a report with a single "can grow" text box called "Text". The code below reads a text file into the control. The name of the file could be an open argument of the report...

(°v°)
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
Dim varText As Variant
 
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    Text = varText
End Sub
 
Private Sub Report_Open(Cancel As Integer)
    
    Dim strLine As String
    
    varText = Null
    Open "C:\somewhere\something.txt" For Input As #1
    Do Until EOF(1)
        Line Input #1, strLine
        varText = varText + vbCrLf & strLine
    Loop
    Close #1
    
End Sub
Random Solutions  
 
programming4us programming4us