473,320 Members | 1,978 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

printing pdf files in in directory/folder using access/vb

2
hi guys i am trying to print many pdf files with just click command using access is it possible
find my code bellow is not working
please any guidance would be much appreciated
Expand|Select|Wrap|Line Numbers
  1. Option Compare Database
  2. Option Explicit
  3. Private Sub PrintToPDF_Click()
  4.         Dim Input_Dir, Print_File As String
  5.         Input_Dir = InputBox _
  6.             ("Input Folder name containing the files to print")
  7.         ' Defines Print_File equal to the first Microsoft Excel file found
  8.         ' in the directory specified in the InputBox above.
  9.         Print_File = Dir(Input_Dir & "\*.pdf*")
  10.  
  11.  
  12.         ' Loops through the directory specified in the above InputBox
  13.         ' and opens each form in the directory, prints all sheets
  14.         ' in the Form and closes the workbook. Continues until are
  15.         ' all files are printed.
  16.         Do While Len(Print_File) > 0
  17.            ' DoCmd.Open:=Input_Dir & "\" & Print_File
  18.            DoCmd.GoToRecord , , acNewRec
  19.             DoCmd.PrintOut Copies:=1
  20.             'ActiveForm.Close
  21.             Print_File = Dir()
  22.         Loop
  23.       End Sub
Feb 11 '15 #1
1 2387
slim92
2
Thanks Stewart Ross for editing my code it was my first time
I will post programmatically better next time.
Feb 12 '15 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Huahe | last post by:
Hello, Can someone help me with this problem. I select an folder using an folderbrowserdialog. I want to check if the selected folder contains any files or folders. If it does, i want to check...
3
by: Jim | last post by:
Is it possible to read the Temporary Internet Files folder using C#? I'm messing with FileIO (newbie here) and everything seems to work fine until I try to read the list of files in this Temporary...
12
by: fanoftvb | last post by:
Hi, i would like to move a selected files to a folder using vb.net. I currently have this code If File.Exists("C:\Documents and Settings\055949x\transfer\text.txt") And Not...
4
by: dillneus | last post by:
Hey I must do the News Storage database. It sounds pretty easy but there is one point I don't know how to do. When I download the news file and save it in .pdf. I have database that records all...
14
by: prashant | last post by:
hello, I am looking to determine the number of image files in a folder so that I could create a dynamic table accordingly. For this i need a method to identify the number of files in a folder. Is...
3
by: ChrisSpencer | last post by:
I had the following line of code working to extract an Excel lfile from a temp.zip folder, but it stopped working about 2 months ago. Set oApp = CreateObject("Shell.Application")...
2
Breeves22
by: Breeves22 | last post by:
Hi all I have no idea if this is possible and doing a general search on the internet yeilded no results so i thought i would ask here. In the database i am creating there will be a need to...
11
NeoPa
by: NeoPa | last post by:
Overview It is often required to prompt the operator of an Access project to select a file or folder. Sure, it's possible to allow them to type it in freehand, or even paste it in from another...
1
by: parvathireddy | last post by:
C-> Visual studio 2010-> windows 7 can any one explain me a sample code ,how to create a directory / folder.( to browse/save my files to a directory.) how to specify the path? I googled , but...
14
by: Aditya23 | last post by:
Hi, I am new to programming and I'm trying to learn from this internship...I tried using folder browse dialog box option in tool box and used the print dialog box too to print the file...I can view...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.