dcsimg
Results 1 to 9 of 9

Thread: Suppress PDF-print pop-up

  1. #1

    Thread Starter
    Member WilliamJames's Avatar
    Join Date
    Aug 2007
    Posts
    56

    Suppress PDF-print pop-up

    Hi all,

    I have a chunck of code in Access to print a report to pdf. For every report the pdf-printer pops up the question wether I want to print the file with that particular name to that particular location - Send to Desktop, Save As, Append to other pdf's.

    These are all things the code sets in advance, so I don't want this pop-up window. How do I suppress it? I am using FreePDF_XP.

    Thanks in advance!

    William

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    24,624

    Re: Suppress PDF-print pop-up

    read the user manual
    page 10
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  3. #3

    Thread Starter
    Member WilliamJames's Avatar
    Join Date
    Aug 2007
    Posts
    56

    Re: Suppress PDF-print pop-up

    hyperlink please? thanks!

  4. #4
    PowerPoster
    Join Date
    Dec 2004
    Posts
    24,624

    Re: Suppress PDF-print pop-up

    http://66.163.168.225/babelfish/tran...PDFXPAdmin.pdf

    try that, i just found it with google
    Last edited by westconn1; Jul 31st, 2010 at 07:09 PM.
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  5. #5

    Thread Starter
    Member WilliamJames's Avatar
    Join Date
    Aug 2007
    Posts
    56

    Re: Suppress PDF-print pop-up

    Thanks for the info so far.

    Does anyone know how my registry file should be composed to disable the pop-up?

    I have tried some stuff, but I cannot seem te get it right...

    fi this does not work...

    Code:
    Windows Registry Editor Version 5.00
    
    [HKEY_CURRENT_USER\Program Files\FreePDF_XP]disabledesktop
    "PDFFilename"="H:\\Macros\\Reports\\EmployeeList_20100803.PDF"
    Thanks in advance!

    Bill

  6. #6
    PowerPoster
    Join Date
    Dec 2004
    Posts
    24,624

    Re: Suppress PDF-print pop-up

    CU/LM ADefaultsaveasLike pushing the Save As button. Dialog will not rise!

    • CU means HKey_Current_User\Software\shbox\FreePdfXp
    • LM means HKey_Local_Machine\Software\shbox\FreePdfXp
    you can set the registry key from within your code and change back after
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  7. #7

    Thread Starter
    Member WilliamJames's Avatar
    Join Date
    Aug 2007
    Posts
    56

    Re: Suppress PDF-print pop-up

    I'm affraid I don't understand how to use this registry file, is it sth like this?

    Code:
    Open strPath & "CreatePDF.reg" For Append As #1
        
        Print #1, "Windows Registry Editor Version 5.00"
        Print #1, ""
        Print #1, "[HKey_Local_Machine\Software\shbox\FreePdfXp]"
        Print #1, "SaveAs=0"
        Print #1, """PDFFilename""=" & Chr(34) & strPDF & Chr(34)
        Close #1
        
        x = Shell("regedit.exe /s " & strPath & "CreatePDF.reg", vbHide)
    
        Kill strPath & "CreatePDF.reg"
    
    Set Application.Printer = Application.Printers("FreePDF XP")
        DoCmd.OpenReport strReport, acViewNormal
    
    Open strPath & "CreatePDF.reg" For Append As #1
        
        Print #1, "Windows Registry Editor Version 5.00"
        Print #1, ""
        Print #1, "[HKey_Local_Machine\Software\shbox\FreePdfXp]"
        Print #1, "SaveAs=1"
        Print #1, """PDFFilename""=" & Chr(34) & strPDF & Chr(34)
        Close #1
        
        x = Shell("regedit.exe /s " & strPath & "CreatePDF.reg", vbHide)
    
        Kill strPath & "CreatePDF.reg"

  8. #8
    PowerPoster
    Join Date
    Dec 2004
    Posts
    24,624

    Re: Suppress PDF-print pop-up

    there are better, more direct ways to read and write registry keys, than to shell to regedit

    search on registry APIs
    or registry scripting

    if strpath can contain spaces shell will fail, unless the path is enclosed in quotes
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  9. #9

    Thread Starter
    Member WilliamJames's Avatar
    Join Date
    Aug 2007
    Posts
    56

    Re: Suppress PDF-print pop-up

    As a matter of fact, I can't seem to get it done, I'm affraid I'm gonna have to let loose this line of thought...

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width