PC Review


Reply
Thread Tools Rate Thread

Printing PDF Files in Order

 
 
Jonas
Guest
Posts: n/a
 
      9th Apr 2010
I have a table with links on it to PDF files. I would like to print
the files in the order that they appear in the table. When I run the
code to print out the files, they seem to come out of the printer in a
random order. Below is a snipet of my code. Does anybody have any
suggestions?

Do Until myRecordset.EOF
tempname = myRecordset.Fields(1).Value
If tempname <> "" Then

tempname2 = Replace(tempname, "#", "")

If fso.FileExists(tempname2) Then
ADOBEPATH = "C:\Program Files\Adobe\Reader 8.0\Reader\AcroRd32.exe"
PDFFILE = tempname2
Shell """" & ADOBEPATH & """/p /h """ & PDFFILE & """"

End If

End If

myRecordset.MoveNext
Loop
 
Reply With Quote
 
 
 
 
Rob Parker
Guest
Posts: n/a
 
      9th Apr 2010
If your recordset is based on the table, there will be no defined order to
it (it will probably be sorted by the primary key field, and the records
should appear in the same order each time). If you need it sorted by a
specific field, build a query which does so, and open the recordset based on
that query.

HTH,

Rob

..
Jonas wrote:
> I have a table with links on it to PDF files. I would like to print
> the files in the order that they appear in the table. When I run the
> code to print out the files, they seem to come out of the printer in a
> random order. Below is a snipet of my code. Does anybody have any
> suggestions?
>
> Do Until myRecordset.EOF
> tempname = myRecordset.Fields(1).Value
> If tempname <> "" Then
>
> tempname2 = Replace(tempname, "#", "")
>
> If fso.FileExists(tempname2) Then
> ADOBEPATH = "C:\Program Files\Adobe\Reader 8.0\Reader\AcroRd32.exe"
> PDFFILE = tempname2
> Shell """" & ADOBEPATH & """/p /h """ & PDFFILE & """"
>
> End If
>
> End If
>
> myRecordset.MoveNext
> Loop



 
Reply With Quote
 
 
 
 
Jonas
Guest
Posts: n/a
 
      12th Apr 2010
On Apr 9, 4:52*pm, "Rob Parker"
<NOrobpparkerS...@optusnet.com.auFORME> wrote:
> If your recordset is based on the table, there will be no defined order to
> it (it will probably be sorted by the primary key field, and the records
> should appear in the same order each time). *If you need it sorted by a
> specific field, build a query which does so, and open the recordset basedon
> that query.
>
> HTH,
>
> Rob
>
> .
>
>
>
> Jonas wrote:
> > I have a table with links on it to PDF files. *I would like to print
> > the files in the order that they appear in the table. *When I run the
> > code to print out the files, they seem to come out of the printer in a
> > random order. *Below is a snipet of my code. *Does anybody have any
> > suggestions?

>
> > Do Until myRecordset.EOF
> > tempname = myRecordset.Fields(1).Value
> > If tempname <> "" Then

>
> > tempname2 = Replace(tempname, "#", "")

>
> > If fso.FileExists(tempname2) Then
> > ADOBEPATH = "C:\Program Files\Adobe\Reader 8.0\Reader\AcroRd32.exe"
> > PDFFILE = tempname2
> > Shell """" & ADOBEPATH & """/p /h """ & PDFFILE & """"

>
> > End If

>
> > End If

>
> > myRecordset.MoveNext
> > Loop- Hide quoted text -

>
> - Show quoted text -


Everything was in order. I created a do until loop to delay the
processing eight seconds which seems to be enough time for the PDF
file to be sent to the printer. It works now.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting files to Adobe PDF, or Printing to Adobe PDF. =?Utf-8?B?TWlrZSBNeWVycyAtIEJDVQ==?= Microsoft Access 1 6th Mar 2007 05:52 PM
Printing pdf files in order =?Utf-8?B?UGF0cmlrIFlsw6lu?= Windows XP Print / Fax 1 6th Apr 2006 05:58 PM
Graph reverse order changes series order but not legend order biddlea Microsoft Excel Misc 0 13th Aug 2004 12:48 PM
Getting "Save as PDF File" Dialog at end of printing to PDF using PDFwriter Chuck Reed Microsoft Excel Programming 4 13th May 2004 12:01 PM
Getting "Save as PDF File" Dialog at end of printing to PDF using PDFwriter Chuck Reed Microsoft Excel Discussion 1 3rd May 2004 11:05 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:48 PM.