Closed Thread
Results 1 to 2 of 2

Setting binary values in Registry?

Hybrid View

  1. #1
    Don Wiss
    Guest

    Setting binary values in Registry?

    I now have the code from this page in my workbook:
    http://support.microsoft.com/default...145679&sd=tech
    It does not support the writing of binary values.

    I found this page: http://www.freevbcode.com/ShowCode.Asp?ID=335
    It does write binary values, but the code cannot coexist with the Microsoft
    code. I tried to modify it, but I wasn't successful. Has anyone merged
    these together?

    What I'm trying to do is to "print" to a PDF file completely using VBA and
    no user intervention. I have Adobe Elements 6.0 installed. It was not
    designed to be run under program control. Some of the settings I want to
    change are binary values. For example, I want to turn off
    PromptForPDFFilename and ViewPDFFile. Maybe others, if I can figure them
    out.

    While getting frustrated with Adobe I found this product:
    http://www.globalpdf.com/pdfcamp/pdf...el-to-pdf.html

    If you read the section on using a program to control it here:
    http://www.verypdf.com/pdfcamp/support/
    You will see how simply something can be designed. My problem is I can't
    get it to work. My VBA can't set the ActivePrinter to it.

    Don <www.donwiss.com> (e-mail link at home page bottom).

  2. #2
    Don Wiss
    Guest

    Re: Setting binary values in Registry?

    On Wed, 16 Aug 2006 21:13:54 -0400, Don Wiss <donwiss@no_spam.com> wrote:

    >While getting frustrated with Adobe I found this product:
    >http://www.globalpdf.com/pdfcamp/pdf...el-to-pdf.html
    >
    >If you read the section on using a program to control it here:
    >http://www.verypdf.com/pdfcamp/support/
    >You will see how simply something can be designed. My problem is I can't
    >get it to work. My VBA can't set the ActivePrinter to it.


    I did get it to work. It can even append the files, which Adobe Elements
    can't do, and would require the purchase of another product. I added the
    below function, and then added the block of code just before printing.

    Function GetPDFPathName()
    ' called by Print Menu

    Dim OldDrive As String, OldPath As String

    ' get existing path so we can restore afterwards
    OldDrive = Left(CurDir, 2)
    OldPath = Application.DefaultFilePath

    ' get the file name to save as
    GetPDFPathName = Application.GetSaveAsFilename(GetNameToStart(True), "Adobe PDF File,*.pdf", Title:="Save As PDF File")

    ' restore
    ChDrive OldDrive
    If OldPath <> "" Then ChDir OldPath

    End Function


    ' get the file path name we will put combined PDF in
    PDFPathName = GetPDFPathName
    ' store current printer (we restore after done printing)
    prtFirst = Application.ActivePrinter
    ' change the application printer to Adobe
    For j = 1 To 9
    Err.Clear
    On Error Resume Next
    Application.ActivePrinter = "PDFcamp Printer on Ne0" & j & ":"
    If Err.Number = 0 Then Exit For
    On Error GoTo 0
    Next j
    On Error GoTo 0

    ' remove any existing file, as we will be appending
    On Error Resume Next
    Kill PDFPathName
    On Error GoTo 0

    ' set so nothing will prompt user
    SetKeyValue "Software\verypdf\pdfcamp", "AutomaticDirectory", PDFPathName, REG_SZ
    SetKeyValue "Software\verypdf\pdfcamp", "AutomaticOutput", 1, REG_DWORD
    SetKeyValue "Software\verypdf\pdfcamp", "AutomaticValue", 4, REG_DWORD
    SetKeyValue "Software\verypdf\pdfcamp", "AutoView", 0, REG_DWORD


    Don <www.donwiss.com> (e-mail link at home page bottom).

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1