Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
other
informationbridge
office.intranets
office.misc
office.setup
office.xml
officeupdate
onenote
photodraw.discussion
powerpoint
producer
proj.standard&server
project
project.developer
project.pro_and_serve
project.server
project.vba
project2000
publisher
publisher.prepress
publisher.programming
publisher.webdesign
visio
visio.createshapes
visio.database.modeling
visio.dev.diagrams
visio.dev.shapesheet
visio.dev.vba
visio.dev.vc
visio.developer
visio.general
visio.installation
visio.printing
visio.software.modeling
visio.troubleshoot
  
 
date: Fri, 11 Jan 2008 08:11:03 -0800,    group: microsoft.public.publisher.programming        back       


Photo Book Ideas?   
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?
date: Fri, 11 Jan 2008 08:11:03 -0800   author:   Ian

RE: Photo Book Ideas?   
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

"Ian" wrote:

> 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?
date: Fri, 18 Jan 2008 13:49:03 -0800   author:   psvogt

RE: Photo Book Ideas?   
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.


"psvogt" wrote:

> 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
date: Sun, 20 Jan 2008 17:00:00 -0800   author:   Ian

RE: Photo Book Ideas?   
Thanks for the tips.
I'm not sure that would actually save any time, but I'll look into it!


"Ian" wrote:

> 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.
> 
> 
> "psvogt" wrote:
> 
> > 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
>
date: Tue, 22 Jan 2008 17:30:18 -0800   author:   psvogt

RE: Photo Book Ideas?   
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.

"psvogt" wrote:

> Thanks for the tips.
> I'm not sure that would actually save any time, but I'll look into it!
date: Tue, 22 Jan 2008 22:25:01 -0800   author:   Ian

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us