Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA Save As

Status
Not open for further replies.

minooperl

Programmer
Jan 15, 2008
6
US
Hello all,

I am trying to save each page of a word document into separate files. Can you tell me how this is possible?

thanks
 
Page" is a funny thing in Word. What is "one page" on your computer may not be the same page on mine. Unless each page is explictly separate by a page break. Not a good idea really, from a design point of view.

You would have to give a bit more detail.

Have you done a search on the issue? It certainly has come before.

Have you done any attempts yourself? If so, how far have you got? If so, post what you have and tell us where you are having problems.


faq219-2884

Gerry
My paintings and sculpture
 
hi,
You are right page is tricky to work with.
What I initially did was to try to print to files but that wasnt successful as what was printed to file was bunch of jiberish characters (i guess that has to do with PLG, printer language format!). The I thought maybe I could save each page into separate files. Story short my save as function is so messy i cant even share with you guys. but here is my print method: I appreicate your feedbacks. thanks

Public Sub RapPrint()

Call FileToPage("/vba/printFrom.doc", "/vba/printTo.doc")
End Sub

Private Sub FileToPage(ByVal printFrom As String, ByVal printTo As String)

With Application
.PrintOut fileName:=printFrom, _
Range:=wdPrintAllDocument, _
Item:=wdPrintDocumentContent, _
Pages:="1", _
PageType:=wdPrintAllPages, _
Collate:=False, _
Background:=False, _
PrintToFile:=True, _
Outputfilename:=printTo
End With

End Sub
 
BTW, This function prints the who document to another file (not yet each page to sepaarate files). I tried this to see if the print method works at all.
 


What is the business case for this requirement?

There may be another way to attack the problem.

Skip,

[glasses]Did you hear what happened when the OO programmer lost his library?...
He's now living in OBJECT poverty![tongue]
 
Yes, and if: "Story short my save as function is so messy i cant even share with you guys."

is true, there is not much we can do.

faq219-2884

Gerry
My paintings and sculpture
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top