Article ID: 108281
Article Last Modified on 6/11/2007
'Enter each of the following Declare Functions as a single line.
Declare Function GetProfileString Lib "Kernel" (ByVal Section As _
String, ByVal Entry As Any, ByVal Default As String, _
ByVal Setting As String, ByVal BytesOutput As Integer) As Integer
Declare Function WriteProfileString Lib "Kernel" (ByVal _
Section As String, ByVal Entry As Any, ByVal EntryValue As Any) _
As Integer
Sub ToggleSpooler()
'Create a buffer to return the string into.
Dim Setting As String * 4
'Find the current value of Spooler in the WIN.INI file.
'Note: enter the following two lines as a single line.
Length = GetProfileString("windows", "spooler", "", Setting, _
Len(Setting))
'If Spooler = yes then set Spooler to no.
'Note: enter the following two lines as a single line.
If Left(Setting, Length) = "yes" Then
Length = WriteProfileString("windows", "spooler", "no")
MsgBox "Spooler has been turned off. Please restart Windows."
Else
'If Spooler = anything other than yes, set spooler to yes.
Length = WriteProfileString("Windows", "spooler", "yes")
MsgBox "Spooler has been turned on. Please restart Windows."
End If
End Sub
Additional query words: change settings XL5
Keywords: kbprogramming KB108281