I wanted to hide the fact that I was using a web object when printing the web object by removing/customizing the IE Headers and Footers that normally print with the page.
Seems to be working in W2k, XP and 98 so I thought I'd share the info.
Essentially you are:
1) locating the registry keys that store the header & footer info
2) Storing them as variables
3) Replacing the variable values with a "space" to remove them or replacing them with some "custom text" to add a custom header or footer
(IndigoRose: Why can't you leave the Registry value blank in the SetValue function? The Delete Value action doesn't work in this case since Windows heals itself with the default settings when this is deleted.)
4)On close or Destroy replacing the Original Header & Footer info.
Here's the On Initialize actions:
<IR_ACTIONS_LIST>
<Action name="Comment">
<Type>202</Type>
<Function>2</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Comment>Get IE Header Footer Info</Comment>
</Action>
<Action name="Get Value Data">
<Type>72</Type>
<Function>0</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Variable>%Header%</Variable>
<MainKey>2</MainKey>
<SubKey>Software\Microsoft\Internet Explorer\PageSetup</SubKey>
<Value>header</Value>
<AutoExpand>0</AutoExpand>
</Action>
<Action name="Get Value Data">
<Type>72</Type>
<Function>0</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Variable>%Footer%</Variable>
<MainKey>2</MainKey>
<SubKey>Software\Microsoft\Internet Explorer\PageSetup</SubKey>
<Value>footer</Value>
<AutoExpand>0</AutoExpand>
</Action>
<Action name="Comment">
<Type>202</Type>
<Function>2</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Comment>Delete IE Header Footer Info</Comment>
</Action>
<Action name="Comment">
<Type>202</Type>
<Function>2</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>0</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Comment>Change IE Header Footer Info</Comment>
</Action>
<Action name="Set Value">
<Type>74</Type>
<Function>0</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<MainKey>2</MainKey>
<SubKey>Software\Microsoft\Internet Explorer\PageSetup</SubKey>
<ValueName>header</ValueName>
<ValueData> </ValueData>
<DataType>1</DataType>
</Action>
<Action name="Set Value">
<Type>74</Type>
<Function>0</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<MainKey>2</MainKey>
<SubKey>Software\Microsoft\Internet Explorer\PageSetup</SubKey>
<ValueName>footer</ValueName>
<ValueData> </ValueData>
<DataType>1</DataType>
</Action>
</IR_ACTIONS_LIST>
Here's the on Close/Destroy Actions:
<IR_ACTIONS_LIST>
<Action name="Comment">
<Type>202</Type>
<Function>2</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Comment>Replace Header Footer Info</Comment>
</Action>
<Action name="Set Value">
<Type>74</Type>
<Function>0</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<MainKey>2</MainKey>
<SubKey>Software\Microsoft\Internet Explorer\PageSetup</SubKey>
<ValueName>header</ValueName>
<ValueData>%Header%</ValueData>
<DataType>1</DataType>
</Action>
<Action name="Set Value">
<Type>74</Type>
<Function>0</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<MainKey>2</MainKey>
<SubKey>Software\Microsoft\Internet Explorer\PageSetup</SubKey>
<ValueName>footer</ValueName>
<ValueData>%Footer%</ValueData>
<DataType>1</DataType>
</Action>
</IR_ACTIONS_LIST>
Seems to be working in W2k, XP and 98 so I thought I'd share the info.
Essentially you are:
1) locating the registry keys that store the header & footer info
2) Storing them as variables
3) Replacing the variable values with a "space" to remove them or replacing them with some "custom text" to add a custom header or footer
(IndigoRose: Why can't you leave the Registry value blank in the SetValue function? The Delete Value action doesn't work in this case since Windows heals itself with the default settings when this is deleted.)
4)On close or Destroy replacing the Original Header & Footer info.
Here's the On Initialize actions:
<IR_ACTIONS_LIST>
<Action name="Comment">
<Type>202</Type>
<Function>2</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Comment>Get IE Header Footer Info</Comment>
</Action>
<Action name="Get Value Data">
<Type>72</Type>
<Function>0</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Variable>%Header%</Variable>
<MainKey>2</MainKey>
<SubKey>Software\Microsoft\Internet Explorer\PageSetup</SubKey>
<Value>header</Value>
<AutoExpand>0</AutoExpand>
</Action>
<Action name="Get Value Data">
<Type>72</Type>
<Function>0</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Variable>%Footer%</Variable>
<MainKey>2</MainKey>
<SubKey>Software\Microsoft\Internet Explorer\PageSetup</SubKey>
<Value>footer</Value>
<AutoExpand>0</AutoExpand>
</Action>
<Action name="Comment">
<Type>202</Type>
<Function>2</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Comment>Delete IE Header Footer Info</Comment>
</Action>
<Action name="Comment">
<Type>202</Type>
<Function>2</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>0</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Comment>Change IE Header Footer Info</Comment>
</Action>
<Action name="Set Value">
<Type>74</Type>
<Function>0</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<MainKey>2</MainKey>
<SubKey>Software\Microsoft\Internet Explorer\PageSetup</SubKey>
<ValueName>header</ValueName>
<ValueData> </ValueData>
<DataType>1</DataType>
</Action>
<Action name="Set Value">
<Type>74</Type>
<Function>0</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<MainKey>2</MainKey>
<SubKey>Software\Microsoft\Internet Explorer\PageSetup</SubKey>
<ValueName>footer</ValueName>
<ValueData> </ValueData>
<DataType>1</DataType>
</Action>
</IR_ACTIONS_LIST>
Here's the on Close/Destroy Actions:
<IR_ACTIONS_LIST>
<Action name="Comment">
<Type>202</Type>
<Function>2</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Comment>Replace Header Footer Info</Comment>
</Action>
<Action name="Set Value">
<Type>74</Type>
<Function>0</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<MainKey>2</MainKey>
<SubKey>Software\Microsoft\Internet Explorer\PageSetup</SubKey>
<ValueName>header</ValueName>
<ValueData>%Header%</ValueData>
<DataType>1</DataType>
</Action>
<Action name="Set Value">
<Type>74</Type>
<Function>0</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<MainKey>2</MainKey>
<SubKey>Software\Microsoft\Internet Explorer\PageSetup</SubKey>
<ValueName>footer</ValueName>
<ValueData>%Footer%</ValueData>
<DataType>1</DataType>
</Action>
</IR_ACTIONS_LIST>
Comment