Changing VISTA Registry entries using VB6

G

Guest

I am trying to change a Registry entry in HKCU to provide a PDF Printer with
its save file name developed from parameters in Microsoft Access 2003.

If I use REG.EXE in a command prompt window ant type in the required changes
using ADD it works fine and changes the required value.

Attempting the same using Shell in VB6 in an Event Procedure on a Command
Button fails to work

The Code below works fine in creating the PDF Document with the Access
Report Name but I need to change the Save file to give it a client code plus
a Quote Number to prevent overwriting each file.

Code for Command Button Below
======================
Dim MyRpt, MyReport, Myfile, MyFile0, MyParam
Myfile = "Quotation_No_" & Me![Order No] & "_for_" & Forms![Order
Descriptions].Form![Client]
MyParam = " ADD " & Chr(34) &
"HKCU\Software\Softland\novaPDF\Printers\novaPDF Pro v5\Profiles\Default
Profile" & Chr(34) & " /v " & Chr(34) & "Save File" & Chr(34) & " /d " &
Chr(34) & Myfile & Chr(34)
MsgBox "REG" & MyParam
MyFile0 = Shell("REG" & MyParam, 0)
MsgBox "Shell " & MyFile0
MyReport = "Customers Quote Report PDF"
MyRpt = MsgBox("Do you wish to print " & MyReport & "?" & vbLf & vbLf &
"[Yes] = Print " & MyReport & " now" & vbLf & "[No] = Cancel the print
request", 292, "Report Printing Options")
If MyRpt = 6 Then
DoCmd.OpenReport MyReport
Else
DoCmd.OpenReport MyReport, acViewPreview
End If

When I look at

"REG" & MyParam

it appears exactly the same as the Command Prompt statement.

Any Ideas would be bery welcome

Many thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top