Announcement

Collapse
No announcement yet.

Remove/change IE Headers & Footers when printing web object

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Remove/change IE Headers & Footers when printing web object

    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>

  • #2
    Re: Remove/change IE Headers &amp; Footers when printing web object

    I'm not sure why it requires you to enter something into the value field. (Mark?)

    I'll log it in the bug database in any case.

    In the meantime, there are at least two workarounds:

    1. Use a dummy value, copy the action to a text editor, edit the XML by hand to remove the dummy value, and paste it back in. Essentially just circumventing the dialog's field validation routines.

    2. You could just set a variable to a blank string, and use the variable in the field instead...that way the field won't be empty at design time, but will be empty at run time. (E.g. set a variable like %blank% to a blank value, and then use %blank% in the Registry action's value field.)
    --[[ Indigo Rose Software Developer ]]

    Comment


    • #3
      Re: Remove/change IE Headers &amp; Footers when printing web object

      As a matter of fact, give this a try for your On Initialize actions:

      <font color=green>
      <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>
      </font color=green>

      (I just edited the xml you pasted to remove the spaces.)
      --[[ Indigo Rose Software Developer ]]

      Comment


      • #4
        Re: Remove/change IE Headers &amp; Footers when printing web object

        Oh, and btw...this is a great tip, thanks for sharing it! [img]/ubbthreads/images/icons/smile.gif[/img]
        --[[ Indigo Rose Software Developer ]]

        Comment


        • #5
          Re: Remove/change IE Headers &amp; Footers when printing web object

          Hey Lorne, you cheated.

          Just kidding, I though about editing the XML by hand too but then decided ...I'm lazy.... and left it since it didn't seem to cause any problems.

          I was already exhausted from trying to figure out a way to do this.

          I started out looking for a way to do it with HTML, Javascript or CSS. All of which failed by the way.

          Then the light bulb hit me. I could use AMS4 to do what I wanted.

          I love this new version!!!

          Comment

          Working...
          X