Changing the page header and footer via the registry

  • Thread starter Thread starter Tony O'Hara
  • Start date Start date
T

Tony O'Hara

Hi all,
I've just found a piece of code in the Microsoft KB
(311280) that supposedly lets me change the page setup,
i.e. page header etc, via the registry. I simply cut and
paste the code into my aspx page but unfortunately I am
getting an error returned on the 'setvalue' line.

'Object reference not set to an instance of an object'

what am I doing wrong?

thanks in advance!

Tony
 
Hello,

Tony O'Hara said:
I've just found a piece of code in the Microsoft KB
(311280) that supposedly lets me change the page setup,
i.e. page header etc, via the registry. I simply cut and
paste the code into my aspx page but unfortunately I am
getting an error returned on the 'setvalue' line.

'Object reference not set to an instance of an object'

You may want to turn to the ng for ASP.NET questions:

news://msnews.microsoft.com/microsoft.public.dotnet.framework.aspnet

Web interface:

http://msdn.microsoft.com/newsgroup...roup=microsoft.public.dotnet.framework.aspnet
 
Tony,
I am curious about what kind of page you are talking in your messag?
Webpage, Word page or a Windows screen?
The error you mention sounds very VB.net language but can be too in an other
language
Cor
 
Basically, this means that you are trying to access a method or property of
a reference to a class which has not been instantiated.

Example.

Dim TAB DataTable
Dim DR as DataRow


DR= TAB.NewRow() <<<<<< This line will give your error because we did not
instantiate it or
point it to an instantiated Object of that type

Had we done this

Dim TAB as New DataTable("MyTable")

No error would have been generated
 
Your oKey is Nothing, presumably because the key requested doesn't exist.

If I may ask, why are you trying to change the page setup properties of IE
on your server? The account your ASP.NET process is running under probably
doesn't even have an HKCU hive. Are you trying to load the browser control
on your server to render pages and then print them? If so I wouldn't
recommend it.
 
Back
Top