Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 he 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
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting binary values in Registry?
On Wed, 16 Aug 2006 21:13:54 -0400, Don Wiss 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 he 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). |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can not open *WKS: blocked by your registry policy setting | Setting up and Configuration of Excel | |||
Why would wks files be blocked by my registry policy setting? | Excel Discussion (Misc queries) | |||
Registry setting for default document type? | Excel Discussion (Misc queries) | |||
VBA read/write registry setting | Excel Programming | |||
VBA read/write registry setting | Excel Programming |