Filehost.ro - gazduire fisiere
Mrrrr's Forum (VIEW ONLY)
Un forum care ofera solutii pentru unele probleme legate in general de PC. Pe langa solutii, aici puteti gasi si alte lucruri interesante // A forum that offers solutions to some PC related issues. Besides these, here you can find more interesting stuff.
Nou pe simpatie:
OnutzaGirl la Simpatie.ro
Femeie
23 ani
Galati
cauta Barbat
24 - 51 ani
Mrrrr's Forum (VIEW ONLY)ReguliInregistrareLoginPozeNu sunteti logat. Lista Forumurilor Pe Tematici
Mrrrr's Forum (VIEW ONLY) / Tutoriale si Ghiduri Utile // Tutorials and useful guides /

[WORD] Print 1st page only from multiple documents

Pagini: 1 Moderat de TRaP, TonyTzu
#1
Mrrrr
AdMiN
Postari: 2388
Source:
http://www.pcreview.co.uk/forums/re-can ... 02783.html


You must create a new macro. The entire text of the macro is:


Sub Print1stPageOnly()
'
' Print1stPageOnly Macro
'
'
Dim MyPath As String
Dim MyName As String
Dim Mydoc As Document

'let user select a path
With Dialogs(wdDialogCopyFile)
If .Display() <> -1 Then Exit Sub
MyPath = .Directory
End With

'strip quotation marks from path

If Len(MyPath) = 0 Then Exit Sub

If Asc(MyPath) = 34 Then
MyPath = Mid$(MyPath, 2, Len(MyPath) - 2)
End If

'get files from the selected path
'and insert them into the doc
MyName = Dir$(MyPath & "*.*")
Do While MyName <> ""
Set Mydoc = Documents.Open(MyPath & MyName)
Mydoc.PrintOut Range:=wdPrintFromTo, From:="1", To:="1"
Mydoc.Close wdDoNotSaveChanges
MyName = Dir
Loop
End Sub


After you hit RUN, select the desired folder where you put all the documents of which you want to print the first page. After you will click the OPEN button, it will automatically start printing.


_______________________________________


 
   
Pagini: 1  
Mergi la