Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 300
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 300
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can not open *WKS: blocked by your registry policy setting Verushka Setting up and Configuration of Excel 3 March 3rd 09 04:21 PM
Why would wks files be blocked by my registry policy setting? EPGrove Excel Discussion (Misc queries) 1 September 11th 08 09:42 PM
Registry setting for default document type? Ann Scharpf Excel Discussion (Misc queries) 1 July 26th 07 06:40 PM
VBA read/write registry setting nelson Excel Programming 2 August 22nd 03 07:08 AM
VBA read/write registry setting nelson Excel Programming 0 August 22nd 03 05:41 AM


All times are GMT +1. The time now is 05:09 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"