Closing a PDF file from VBA

  • Permalink
  • submit to reddit
  • Email
  • Follow


I've written some code which opens a PDF file using :

"Application.FollowHyperlink strdbFilePath & strFileName, , True"

The user then types some information into the form and then clicks a
button which generates a new filepath for the file. Unfortunatly, if
the user doesn't close the PDF file, the whole thing grinds to a halt.
Just wondering if there is some code that I could put in the button to
close the pdf file when clicked??

Cheers

Reg

0
Reply p.heywood (76) 8/8/2006 9:37:10 AM

See related articles to this posting


Regnab wrote:

> I've written some code which opens a PDF file using :
> 
> "Application.FollowHyperlink strdbFilePath & strFileName, , True"
> 
> The user then types some information into the form and then clicks a
> button which generates a new filepath for the file. Unfortunatly, if
> the user doesn't close the PDF file, the whole thing grinds to a halt.
> Just wondering if there is some code that I could put in the button to
> close the pdf file when clicked??
> 
> Cheers
> 
> Reg
> 
Check out
http://www.mvps.org/access/api/api0007.htm
http://www.mvps.org/access/api/api0013.htm
http://www.mvps.org/access/api/api0025.htm

One of these should help.

With 13, and some mods on your part, you can get both class and caption.

I like http://www.mvps.org/access/api/api0018.htm to open up files 
instead of FollowHyperLink.  I can control the window state and I can 
have the user dblclick instead of single click like a hyperlink part (I 
separate the display text from the address and use the dblclick event).
0
Reply oil (4048) 8/8/2006 3:04:04 PM

Thanks Salad,

Works a treat. Might be pushing my luck a little now, but is it
possible to close the file rather than the application. What you've
pointed me to works great and will do what I need.... but in the ever
growing desire to make one's databases a little more effecient, is it
possible to close just the file (as I think this would make subsequent
pdf file opening quicker if adobe is already running).

The other thing you mentioned that I was curious about is it allows you
to control the window state. What does that mean?

Thanks for all your help

Cheers

Reg

0
Reply p.heywood (76) 8/8/2006 10:57:42 PM

Regnab wrote:
> Thanks Salad,
> 
> Works a treat. Might be pushing my luck a little now, but is it
> possible to close the file rather than the application. What you've
> pointed me to works great and will do what I need.... but in the ever
> growing desire to make one's databases a little more effecient, is it
> possible to close just the file (as I think this would make subsequent
> pdf file opening quicker if adobe is already running).
> 
You might want to google around...see
	http://groups.google.com/advanced_search
and enter
	*Access*
in the groups texbox and something like
	Adobe automation
in the search for.

If Adobe allows automation, you'll probably find some code to do a 
file/close or file/save


> The other thing you mentioned that I was curious about is it allows you
> to control the window state. What does that mean?

Min, Max, etc.
> 
> Thanks for all your help
> 
> Cheers
> 
> Reg
> 
0
Reply oil (4048) 8/9/2006 12:38:48 AM
comp.databases.ms-access 42284 articles. 10 followers. Post

3 Replies
452 Views

Similar Articles

[PageSpeed] 36


  • Permalink
  • submit to reddit
  • Email
  • Follow


Reply:

Similar Artilces:

composing a simple batch file for closing a pdf-file
Dear everybody, I got no clue about programming in windows so I wish to ask you for help with writing a simple batch file which shall do the following: closing a pdf-file opened in adobe acrobat without exiting the program itself (ctrl+F4). Why: because I wish to be able to shut that pdf-file with starting the batch file through pressing a shortcut, without actually having the adobe window in active mode. Thanks for your help and many greetings from Dresden. Robert Anderssohn ...

create a pdf file from vba
Hello, I've code right here that create a pdf from any document and merge it to another existing pdf. My only problem is that when I use the function >>>>> avFormCapture.Open "", "" <<<<< to create the pdf, the files is opened. Is there way so nothing open or instead just some kind of progress bar ? Thanks The code I use : Option Compare Database Option Explicit Sub Attach2Pdf() Dim objCurrent As AccessObject Dim Acroapp As CAcroApp Dim avCodeFile As CAcroAVDoc Dim avFormCapture As CAcroAVDoc Dim pdCodeFile As...

Creating simple PDF files with VBA
Anyone have a VBA routine that will write simple PDF files? I have seen the "howto_write_pdf_report" sample by Dinesh Asanka but I wanted something that I can use directly from MS-Access 2000 VBA. Thanks. As I don't know so much about MS-Access 2000 VBA, is it dealing with COM Component? If so, you could use DirectPDF (directpdf.free.fr) , which is a PDF library built as a COM Component. If no, you have to find another way. Flo "BillB" <please_reply@via_newsgro.up> a �crit dans le message de news: Lbk2d.3402$n16.2938@newsread2.news.atl.earthlink.net... &...

File opening closing and wriing in VBA
Hi guys i ahve a problem writing the following code in VBA, I have a number of directories with files in each, the workbooks are all listed with year names ie yellow1985.xls yellow1986.xls red1987.xls red1988.xls etc etc. In some cases there can be as many as 60 workbooks and in others its as low as 3 or 4 workbooks. I wish to do the following, open each file sequencially from yellow1924.xls to yellow1998.xls or red1986.xls to red1989.xls. Somtimes ther will be a need for there to be more than 1 file open for inputting and in some cases there will need to be as many as 5 workbboks to be open. ...

Sending a pdf file to default printer from vba
Hi folks. I've got a need to print a preexisting pdf file after an Access report, as a pseudo attachment. Seems it should be easy, but how do I send a pdf file to the default printer? Do I need to run something from shell()? A pointer to the name of a command to use would be very appreciated- then I would be armed with a good keyword to use in google, heh. Thanks! Ann This is Access 97, I should have mentioned. Also, I have pdf995 installed, wonder if I should try to find a way to use that from the command line. --Thanks. On 3 Mar 2005 14:40:54 -0800, cantelow@csd.net wrote: ...

Can VB or VBA code manipulate PDF files?
Hello, I was wondering whether it's possible to do any basic manupilation of _existing_ PDF files using VB or VBA code. e.g. Add a line of additional text at a designated point in the document. Similar to how you can use bookmarks in a Word doc to add text uing VB or VBA code. If so can anyone point me to some sample code or some other reference? Note: I own the full version of Adobe Acrobat if this makes any difference. Cheers. ...

pdf is bigger in size when converted from VBA ms-word than .DOC file
HELLO Everybody ! I am using Acrobat 4.0.1 and I am converting the MS-WORD doc file into ..PDF file by VBA. The code works but my problem is when I tried to check the size of the converted .PDF file it is 138 kb whereas when I saved the same document by .DOC file it is only 19 kb . How come the PDF file is more bigger in size than .DOC file , isn't supposed the PDF file should be much lesser in size than the .DOC FILE? Then I tried to convert the current document manually to PDF file and then I check the converted .PDF file it is only 10kb at least smaller than saved .DOC file if done ma...

Open folder, read file, close file, open new folder, read file close file etc....
Hello, My current directory has several folders within it. Each folder has the same type of file within it. How do i go from the current directory, into one of the folders, edit the file, then come out of the folder, then go into another folder, edit a file then come out of the folder then into a new one etc etc etc. If this does not make sense i apologise and will try to explain my problem a little better. Any help would be much appreciated. Cheers, Phil Phil: I'm not sure it makes sense. Personally I use the mouse and keyboard for doing this. Were you thinking of something else?...

A PDF into a FM file then save as pdf... how to have alll the pages of the included pdf file
FM 7.2 We can import a complete PDF file as an object into a framemaker file. Then when we try to generate a pdf from this framemaker file, we have only the firts page of the pdf imported. Is there a method to import a pdf file and force FM to generate a pdf file with save as... with the complete pdf file inserted into the padf ? > We can import a complete PDF file as an object into a framemaker file. Then > when we try to generate a pdf from this framemaker file, we have only the > firts page of the pdf imported. > > Is there a method to import a pdf file...

Merge pdf files into one pdf file
Hi I am looking for a script that can automatically merge a serie of 'pdf' files into one 'pdf' file. I know about the "Insert pdf file" option in adobe, but I have about 30 'pdf' files, and need a more automatic solution. Today I am merging several "ps" files into one "pdf" file by using the script below. Is there a similar script for pdf files. Any software that solves this? Any help is appreciated! Gisle Rong Script: %! % PostScript program for distilling and combining multiple PostScript files. % When embedding font subsets, it is ...

split one pdf file into multiple pdf files
Hi I am in urgent need of code for spliting one pdf file into multiple pdf files based on a particular condition. An guidance going about writing code for this problem would be really helpful. Thanks, Suparana Hi, What are the particular conditions you need for splitting. There are a number of third party solutions, but most will split on page or file names. If you had the source of the PDF files, I could show you how my OctoTools could produce the output already split, on just about ANY criteria, but doing it with existing pdf's could be tricky. Another way to approach your problem i...

2 pdf-files > 1 pdf-file
Hello, I use Photoshop Lite or CutePDF to scan documents to pdf. What to do if documents are spread out over 2 or more A4's? How can I scan this to just 1 pdf-file? Peter You should use only ADOBE ACROBAT software. "PeterS" <pghscholtes@home.nl> wrote in message news:bk20l8$lom$1@news3.tilbu1.nb.home.nl... > Hello, > > I use Photoshop Lite or CutePDF to scan documents to pdf. What to do if > documents are spread out over 2 or more A4's? How can I scan this to > just 1 pdf-file? > > Peter > ...

How to: split 1 pdf file to 2 pdf files?
I have a problem with a file that I retrieve off www.catholic-forum.com/bulletins/511.pdf . Once each month they create the 511.pdf file with an attached Parish Calendar page. The Parish Bulletin page is in 'Portrait' sizing while the attached Parish Calendar page is in 'Landscape'. I try to retrieve this one file and using Frontpage on my PC attempt to publish the pdf file to my online web. I do NOT want the online web User to have to scroll to the left to see the Bulletin or the Calendar. I have Acrobat Reader 7.0 on my PC and would like to save the www.catholic-forum....

Batch converting of PDF files into searchable PDF files
Hello Group We need to convert about 500 multipage non-searchable PDF files into searchable PDF files. The original PDFs just contain the scanned documents and we plan to run them through an OCR program which will afterwards save them back in the PDF format. It seems that Omnipage 12 Pro Office edition would be able to do the job but Omnipage 12 Standard, which is much less expensive, seems to have many of the same features. Unfortunately I wasn't able to find a resource which lists the exact differences between the two programs. For now we'd require only one or two licences...

split one pdf file into multiple pdf files #2
Hi I am in urgent need of code for spliting one pdf file into multiple pdf files based on a particular condition. Guidance of how to go about writing the code for this problem would really helpful. Thanks, Suparana ...

How print a pdf file on both sides of a paper(Duplexing for pdf files)
Hi All, Please let me know how to print a pdf file on both sides of a papers. Thanks in advance. krishnapalvadi@gmail.com wrote: > Hi All, > Please let me know how to print a pdf file on both sides of a > papers. > Thanks in advance. > Do you have a duplex printer? krishnapalvadi@gmail.com wrote: > Hi All, > Please let me know how to print a pdf file on both sides of a > papers. > Thanks in advance. The same way that you would print any other document on both sides of the paper. You select duplex output in your printer driver properties. Presuma...

How to create two pdf files into one pdf file using pdflatex?
Hi, there! I use MikTeX on my PC. I have a tex file, I use pdflatex to create a pdf file. Now my problem is that I have other a pdf file, I want to put two pdf into a pdf file. Does anyone have suggestion to do this? I am like to put some tex code into my tex file, then I run pdflatex, I will create this two pdf files into one pdf file. Thanks! zyx wrote: > Hi, there! > > I use MikTeX on my PC. I have a tex file, I use pdflatex to create a > pdf file. Now my problem is that I have other a pdf file, I want to put > two pdf into a pdf file. Does anyone have suggesti...

Closing relatef files with script step "close files"
Hello, I would like to create a script to update my database created in Filemaker Pro 7. To do this I also created a file called "updater" in which I can perform scriptsteps with the files that have to be updated to a new version. At a certain point I would like to close all open files exept the active file, being "update". For this I use "Close File". This doesn't work because the files that have to be closed have relations with other files. Therefore while closing one file, Filemaker automatically opens the file again if this file has a relationship ...

PDF::Writer, create pdf and insert in other pdf file.
Hi folks(wharever it mean my english is so bad...) the following code create a PDF: #!/usr/bin/ruby require 'pdf/writer' pdf = PDF::Writer.new pdf.text "Hello Matz", :font_size => 22 pdf.save_as "novo.pdf" ######################################## now I wanna save this pdf as a last page of a existing pdf. any tips? -- Posted via http://www.ruby-forum.com/. On Wed, Mar 26, 2008 at 1:23 PM, Ricardo Pog <ricardo85x@gmail.com> wrote: > Hi folks(wharever it mean my english is so bad...) > > > the following code create a PDF: > >...

How to find New File,Write file and close file?
Hi Anyone can show me how to find New File,Write File and close file in block diagram.The picture of file names are as show in pics. Thanks &nbsp; Nyan Lin File find.JPG: http://forums.ni.com/attachments/ni/170/322096/1/File find.JPG Hi. The functions You're looking for are under "File I/O --&gt; Advanced File Functions" (At least the NEW File) The 2 others are in the "File I/O" menu on the functions palette. Good luck.Message Edited by BCL@Servodan on 05-08-2008 03:38 AM Hi again. My mistake. I was looking in my LabView7. In 8.5.1 the Icons have changed.....

How to convert eps to pdf with pdf file size same as the eps file BBox? (using ps2pdf)
I want to convert an eps file to a pdf file and the paper size of the newly created pdf file be the same as the BBox of the eps file. Would you please show me what options I should specify if I use ps2pdf? Or you can tell me some other ways. Thanks, Peng > I want to convert an eps file to a pdf file and the paper size of the > newly created pdf file be the same as the BBox of the eps file. Would > you please show me what options I should specify if I use ps2pdf? Or > you can tell me some other ways. This will do it: -dEPSCrop Govert Govert J. Knopper wrote: >> I want...

insert pages from auxiliary pdf file into specific page locations in main pdf file
I am saddened by the slow death of usenet. Sigh. It is tax season in my neck of the woods. Depending on what tools you use,= you might end up with forms that don't make a duplex printer-friendly PDF = file. Since my home printer is "manually duplexed", I would like to write = a bash script to insert the pages of auxiliary files into a main PDF file. = Make a huge file that can print out easily with minimal manual interventio= n other than one flip of the whole file once the odd sides have printed out= .. Oh, and I'm looking for a free open source solution. ...

are pdf files graphic files?
Someone told me a PDF file is a graphics file, and I wondered about that. There are a few processes involved in a PDF file. Does anybody have a clear, technical answer? Is a PDF file actually a graphics file? wolfie Zol wrote: > Someone told me a PDF file is a graphics file, and I wondered > about that. There are a few processes involved in a PDF file. > Does anybody have a clear, technical answer? Is a PDF file > actually a graphics file? > > wolfie What do you mean by "graphics file"? It is a file format that Graphic Artists might produce. It can contai...

postscript file and pdf file
Dear Sir: On web if I need to download an ariticle, most of them are pdf files, which I can open it through acroread program. Ocassionally, there are postscript files(ps files). I noticed the size of a ps file is very big, while pdf file is small. I am curious why some people use ps files, not pdf files. I know that it is very easy to use ps2pdf, pdf2ps to change between them. I am just wondering if there is any advantage for using postscript files. By the way, for printing a postscript file, the printer needs to be a postscript printer, right? Thank you very much. Best Regards, Xia...