I'm changing the port value in the registry for the default printer. However when you bring up the port details from printer properties, they don't reflect the new port in the registry?
I'm I missing something?
Thanks
Kev.
Code:Call SetKeyValue(HKEY_LOCAL_MACHINE, "SYSTEM\CurrentControlSet\Control\Print\Printers\Adobe PDF", "PORT", strPortValue, REG_SZ) Dim LngValue$ Dim rtn As Long Dim lValue As Long Dim sValue As String ' Call ParseKey(Subkey, MainKeyHandle) LngValue = vValueSetting If lRoot Then rtn = RegOpenKeyEx(lRoot, sKeyName, 0, KEY_WRITE, hkey) If rtn = ERROR_SUCCESS Then Select Case lValueType Case REG_SZ sValue = vValueSetting & Chr$(0) rtn = RegSetValueExString(hkey, sValueName, 0&, lValueType, sValue, Len(sValue)) Case REG_DWORD lValue = vValueSetting rtn = RegSetValueExLong(hkey, sValueName, 0&, lValueType, lValue, 4) End Select If Not rtn = ERROR_SUCCESS Then If DisplayErrorMsg = True Then MsgBox "Error Message" & rtn End If End If rtn = RegCloseKey(hkey) Else If DisplayErrorMsg = True Then MsgBox "Error Message" & rtn End If End If End If




Reply With Quote