Author : Dipen Anovadia
Date Submitted : 8/25/2005
Category : Other
Compatibility : VB 6,VB 5
This code has been accessed 3257 times.
Task : Open Control Panel Files.
Declarations
Code
Public Sub OpenCPLFile(sCPL As String, Optional sArgs As String = "")
'Desktop Properties @ Customize Desktop:
'OpenCPLFile "desk.cpl", ",@web"
'Time-Date Properties
'OpenCPLFile "timedate.cpl"
On Error Goto errOCF
Dim sFullCommand As String
sFullCommand = "Rundll32.exe " & sCPL
'Commas ',' before arguments may not work with every cpl files
if Not (sArgs = "") Then _
sFullCommand = sFullCommand & "," & sArgs
Shell sFullCommand
Exit Sub
errOCF:
MsgBox Err.Description, vbCritical, "Error " & Err
Err.Clear
End Sub
'Comments are welcomed...