how can I print and close document and window from macro

K

kbgrunt

I run the script below (thanks Jay Freedman) from a batch file to open an
ASCII text file, and compress 136 column report to print on letter size paper.

Can I print, close the document and window so user does nothing but click on
batch file?

Public Sub SetupReport()
Documents.Open "C:\docs\wide.txt"
ActiveDocument.PageSetup.Orientation = wdOrientLandscape
With ActiveDocument.Range
.Font.Name = "Courier New"
.Font.Size = 7
End With
End Sub

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top