Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Publisher / Programming / January 2008

Tip: Looking for answers? Try searching our database.

Photo Book Ideas?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ian - 11 Jan 2008 16:11 GMT
I use Publisher 2007 to produce photo books.  This essentially involves
taking a large number of picture files, putting them all into a book format
using a limited number of pre-defined formats and then producing a pdf file
for uploading.  I found that this could be a tedious, time-consuming process
and therefore decided to write some macros to automate the process as much as
possible.  What might have taken hours can now be done in a few seconds.

The following code, for example, allows the user to select multiple picture
files (perhaps all those in a particular folder) using a standard Windows
dialog box and to write the results into a text file for subsequent
processing.

 Dim myFile As String
 Dim Exists As Boolean
 Dim Choice As Integer
 Dim fs As Object, f As Object
 Dim fd As FileDialog
 Dim myItem As Variant
   
 myFile = "C:\Users\Ian\Pictures\Create_Book\PictureList.txt"
 Exists = IIf(Len(Dir(myFile)) > 0, True, False)
 Choice = vbYes
 If Exists Then
    Choice = MsgBox("A PictureList file already exists.  Do you want to
overwrite it?" _
      & Chr(13) & Chr(10) & Chr(13) & Chr(10) & _
      "(Current selections will otherwise be appended to the existing
file.)", vbYesNo, _
      "Overwrite or append?")
    If Choice = vbYes Then
       Kill myFile
    End If
 End If
 Set fs = CreateObject("Scripting.FileSystemObject")
 Set f = fs.OpenTextFile(myFile, IIf(Choice = vbYes, 2, 8), True)
 Set fd = Application.FileDialog(msoFileDialogFilePicker)
 fd.Filters.Clear
 fd.Filters.Add "Pictures", "*.jpg", 1
 If fd.Show = -1 Then
    For Each myItem In fd.SelectedItems
      f.WriteLine myItem
    Next
 End If
 f.Close
 Set fd = Nothing
 MsgBox "Done."

Anybody interested in discussing?
psvogt - 18 Jan 2008 21:49 GMT
I've never attempted macros- but I am interested in what you are doing.
In my application, I would be adding just one photo to 300 or so half-page
flyers.  Different photos for each flyer.  How does your macro know which
photo to place where?
psvogt

> I use Publisher 2007 to produce photo books.  This essentially involves
> taking a large number of picture files, putting them all into a book format
[quoted text clipped - 44 lines]
>
> Anybody interested in discussing?
Ian - 21 Jan 2008 01:00 GMT
You would want the picture files, as listed within the text file, to be in
the same order as they are to be used.  This could be done in a number of
ways.

1)  You could rename the picture files to reflect the desired order (e.g.
001, 002, etc.) and then simply select the pictures as one large group.

2)  You could select and write the picture files into the text file in the
desired order.  This would be tedious on a one-by-one basis but could work
well if you have only a few large blocks of pictures.

3)  You could edit the text file.

> I've never attempted macros- but I am interested in what you are doing.
> In my application, I would be adding just one photo to 300 or so half-page
> flyers.  Different photos for each flyer.  How does your macro know which
> photo to place where?
> psvogt
psvogt - 23 Jan 2008 01:30 GMT
Thanks for the tips.
I'm not sure that would actually save any time, but I'll look into it!

> You would want the picture files, as listed within the text file, to be in
> the same order as they are to be used.  This could be done in a number of
[quoted text clipped - 14 lines]
> > photo to place where?
> > psvogt
Ian - 23 Jan 2008 06:25 GMT
The payoff, if any, would be dependent upon how you might envision being able
to use the text file.

I image that, in your case, you might want to set up a one page publication
with two flyers on it and with placeholders for the pictures.  A loop in a
second macro could then replace the top picture, replace the bottom picture,
and then print the page.  The loop would repeat these steps 150 times or so
until the macro reached the end of the text file.

If the ordering of the flyers is of importance and if you have to start out
with a set of pictures in no particular order, then I would be inclined to
paste the unsorted text file into a spreadsheet and then, in a separate
column, number them however you might want, sort the list by this number and
paste the file names back into the text file.  One way or the other, you
would have to go through some manual process.

> Thanks for the tips.
> I'm not sure that would actually save any time, but I'll look into it!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.