Batch save each page as .jpg

K

Kewl Baby

I have a catalog type file that has about 30 pages. I need to save each page
as a .jpg file.

Is there a faster way to do this than individually saving each page as a
group and right clicking? I was hoping for a batch editting type command.
 
J

JoAnn Paules [MVP]

I would do it with Acrobat but not everyone has that luxury. Thirty pages is
a bit but it could be worse.
 
E

Ed Bennett

Kewl said:
I have a catalog type file that has about 30 pages. I need to save each page
as a .jpg file.

Is there a faster way to do this than individually saving each page as a
group and right clicking? I was hoping for a batch editting type command.

You can use VBA. Try the following code:

Sub SaveEachPageAsPicture
Dim i As Integer
For i = 1 to ThisDocument.Pages.Count
ThisDocument.Pages(i).SaveAsPicture "c:\temp\pub_page" & _
i & ".png"
Next
End Sub

(Note: This code has not yet been tested, as I don't yet have Publisher
installed)
 
K

Kewl Baby

Thanks for the replies.

I never thought of the VBA code. I took a VB course a while back, but don't
ever use it.

I ended up writing a Macro in a third party that I ran for each page and got
through them pretty quick.

Thanks again!
 
D

Danny

I have about 700 Publisher files I need to change to jpg. Can you tell me
how you did it? I'm not a whiz and don't know what VBA or Macros are.
Difficult?
 
E

Ed Bennett

Danny said:
I have about 700 Publisher files I need to change to jpg. Can you tell me
how you did it? I'm not a whiz and don't know what VBA or Macros are.

If the publications have uniform name (e.g. File1.pub, File2.pub, etc.),
then it's trivial. If not, it becomes slightly harder.
 
C

Charbel

Hi,

In my case I have a couple of hundred publisher files all with a standard
name incremented by number and weekending date e.g: 200-12112006.pub

They reside in a folder carrying the number i.e : 200/200-12112006.pub
So what I need to do is loop through all fodlers for each pub file save as
image in the same file directory then modify the date of the newly created
files to be 12112006 in the case of the sample above.

The code below does the saving part nicely and exactly how I want it to be,
however I am still missing the other parts.
Dim i As Integer
Dim num As String
num = Mid(ThisDocument.Name, 1, 3)
For i = 1 To ThisDocument.Pages.Count
ThisDocument.Pages(i).SaveAsPicture num & "p" & i & ".png"
Next

Can anyone help me out please.

Thanks.

Charbel.
 
C

Charbel

For the benefits of others, I have managed to write the complete code to do
what I wanted to do.
I am still missing only one thing and that is the date setting of the
generated files.

You may need to change the
Here is the code:

Sub test5()
Dim myDate, fileName
Dim appPub As New Publisher.Application

myDate = CDate(#6/11/2006#)

For i = 361 To 378
fileName = i & "-" & Format(myDate, "DDMMYY") & ".pub"

appPub.Open fileName:="D:\WeeklyBulletin\weekly\" & i & "\" &
fileName, ReadOnly:=True, AddToRecentFiles:=False,
SaveChanges:=pbPromptToSaveChanges

For j = 1 To appPub.ActiveDocument.Pages.Count
appPub.ActiveDocument.Pages(j).SaveAsPicture
"D:\WeeklyBulletin\weekly\" & i & "\" & i & "p" & j & ".png"
Next

appPub.ActiveDocument.Close

myDate = myDate + 7
Next i
End Sub
 

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