Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista General Discussion > Changing VISTA Registry entries using VB6

Reply
Thread Tools Display Modes

Changing VISTA Registry entries using VB6

 
 
ExcelUser
Guest
Posts: n/a

 
      10-06-2007
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\novaP DF 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


 
Reply With Quote
 
 
 
 
mayayana
Guest
Posts: n/a

 
      10-06-2007
Shelling to an outside EXE to set Registry values?!

If you don't know about the Registry API
then see here for a VB6 class that makes it easy:

http://www.vbaccelerator.com/codelib...g/registry.htm


> 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\novaP DF 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
>
>



 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Registry entries Kate Windows Vista Installation 4 03-25-2008 09:13 PM
undeletable registry entries dev@null.invalid Windows Vista Installation 2 10-29-2007 08:58 AM
Vista Registry Entries Mr. Greg Windows Vista General Discussion 2 07-25-2007 07:18 PM
Restore .avi registry entries. Cat Windows Vista General Discussion 1 04-15-2007 08:48 AM
Cannot acces registry entries in HKEY_CLASSES_ROOT in x64 mvalpreda Windows Vista General Discussion 0 03-01-2007 05:33 AM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59