How can I get the Office version

D

DavidE

Hi,
I need to know the office version of the client to use the right component.
I use OWC(Office Web Component) and there is differences between the versions.
In office 2000:classid=CLSID:0002E500-0000-0000-C000-000000000046
In office 2003:classid=CLSID:0002E55D-0000-0000-C000-000000000046
In the source it looks like this (html / asp) :
<OBJEC! id=ChartSpace1 style="WIDTH: 100%; HEIGHT: 350px"
classid=CLSID:0002E500-0000-0000-C000-000000000046>

Thanks
David
 
A

Alvin Bruney - ASP.NET MVP

You need to write a sniffer routine, there is code in this newsgroup that i
have provided early this year or last year - if you search the archives that
will sniff out the client version.

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
 
D

DavidE

Hi Alvin,
I found your code. I don't need to download because I use the intranet and I
just use the lines that indicate the client office version
<script language="vbscript">

Sub CheckForOWC()
Dim objOWC
on error resume next
Set objOWC = CreateObject("OWC10.Chartspace")
if(objOWC.MajorVersion < 10) then
'here I have to set the object classid to
CLSID:0002E500-0000-0000-C000-000000000046 (for office 2000)

else
'here I have to set the object classid to
CLSID:0002E55D-0000-0000-C000-000000000046 (for office xp,2003)

end if
End Sub
</script>
after that script I have this html:
<body >
<div>
<table align="right" border="1" width="100%" >
<object classid="CLSID:0002E500-0000-0000-C000-000000000046"
id="ChartSpace1" style="HEIGHT: 410; WIDTH: 100%" VIEWASTEXT></object>
</table>
</div>
</body >

I don't know how to tie the CheckForOWC() procedure result to the object
that declared in html section.In other words, How can I change the object
classid that is declared in the html section with the result of CheckForOWC()
that declared in the script section ?

Thanks for your help,
David


Alvin Bruney - ASP.NET MVP said:
You need to write a sniffer routine, there is code in this newsgroup that i
have provided early this year or last year - if you search the archives that
will sniff out the client version.

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------



DavidE said:
Hi,
I need to know the office version of the client to use the right component.
I use OWC(Office Web Component) and there is differences between the versions.
In office 2000:classid=CLSID:0002E500-0000-0000-C000-000000000046
In office 2003:classid=CLSID:0002E55D-0000-0000-C000-000000000046
In the source it looks like this (html / asp) :
<OBJEC! id=ChartSpace1 style="WIDTH: 100%; HEIGHT: 350px"
classid=CLSID:0002E500-0000-0000-C000-000000000046>

Thanks
David
 
A

Alvin Bruney - ASP.NET MVP

conditionally write it out to the screen using the response.write object
response.write<"clsid" etc

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------



DavidE said:
Hi Alvin,
I found your code. I don't need to download because I use the intranet and I
just use the lines that indicate the client office version
<script language="vbscript">

Sub CheckForOWC()
Dim objOWC
on error resume next
Set objOWC = CreateObject("OWC10.Chartspace")
if(objOWC.MajorVersion < 10) then
'here I have to set the object classid to
CLSID:0002E500-0000-0000-C000-000000000046 (for office 2000)

else
'here I have to set the object classid to
CLSID:0002E55D-0000-0000-C000-000000000046 (for office xp,2003)

end if
End Sub
</script>
after that script I have this html:
<body >
<div>
<table align="right" border="1" width="100%" >
<object classid="CLSID:0002E500-0000-0000-C000-000000000046"
id="ChartSpace1" style="HEIGHT: 410; WIDTH: 100%" VIEWASTEXT></object>
</table>
</div>
</body >

I don't know how to tie the CheckForOWC() procedure result to the object
that declared in html section.In other words, How can I change the object
classid that is declared in the html section with the result of CheckForOWC()
that declared in the script section ?

Thanks for your help,
David


Alvin Bruney - ASP.NET MVP said:
You need to write a sniffer routine, there is code in this newsgroup that i
have provided early this year or last year - if you search the archives that
will sniff out the client version.

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------



DavidE said:
Hi,
I need to know the office version of the client to use the right component.
I use OWC(Office Web Component) and there is differences between the versions.
In office 2000:classid=CLSID:0002E500-0000-0000-C000-000000000046
In office 2003:classid=CLSID:0002E55D-0000-0000-C000-000000000046
In the source it looks like this (html / asp) :
<OBJEC! id=ChartSpace1 style="WIDTH: 100%; HEIGHT: 350px"
classid=CLSID:0002E500-0000-0000-C000-000000000046>

Thanks
David
 
D

DavidE

Hi Alvin,
Thanks for your answer.
I don't understand your solution because the function that check the OWC
version is in the client side and response.write is in the server side which
execute before the client side so how can I use sever side to display an
object if I have to write the object version in the response.write statement
and the object version depend on the client side function which execute last
?
I hope I'm clear.
A little example may help me to understand what you mean.

All the best,
David

Alvin Bruney - ASP.NET MVP said:
conditionally write it out to the screen using the response.write object
response.write<"clsid" etc

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------



DavidE said:
Hi Alvin,
I found your code. I don't need to download because I use the intranet and I
just use the lines that indicate the client office version
<script language="vbscript">

Sub CheckForOWC()
Dim objOWC
on error resume next
Set objOWC = CreateObject("OWC10.Chartspace")
if(objOWC.MajorVersion < 10) then
'here I have to set the object classid to
CLSID:0002E500-0000-0000-C000-000000000046 (for office 2000)

else
'here I have to set the object classid to
CLSID:0002E55D-0000-0000-C000-000000000046 (for office xp,2003)

end if
End Sub
</script>
after that script I have this html:
<body >
<div>
<table align="right" border="1" width="100%" >
<objec! classid="CLSID:0002E500-0000-0000-C000-000000000046"
id="ChartSpace1" style="HEIGHT: 410; WIDTH: 100%" VIEWASTEXT></object>
</table>
</div>
</body >

I don't know how to tie the CheckForOWC() procedure result to the object
that declared in html section.In other words, How can I change the object
classid that is declared in the html section with the result of CheckForOWC()
that declared in the script section ?

Thanks for your help,
David


Alvin Bruney - ASP.NET MVP said:
You need to write a sniffer routine, there is code in this newsgroup that i
have provided early this year or last year - if you search the archives that
will sniff out the client version.

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------



Hi,
I need to know the office version of the client to use the right
component.
I use OWC(Office Web Component) and there is differences between the
versions.
In office 2000:classid=CLSID:0002E500-0000-0000-C000-000000000046
In office 2003:classid=CLSID:0002E55D-0000-0000-C000-000000000046
In the source it looks like this (html / asp) :
<OBJEC! id=ChartSpace1 style="WIDTH: 100%; HEIGHT: 350px"
classid=CLSID:0002E500-0000-0000-C000-000000000046>

Thanks
David
 
A

Alvin Bruney - ASP.NET MVP

version is in the client side and response.write is in the server side
which
execute before the client side
It works the opposite way.

The black book has a more in-depth example but the idea is
in your page load routine

if !Page.Ispostback
{
Response.Write("<script> create an owc instance here and test it for null
</script>");
Response.Write("<script> if it is not null, then test for version 0,10 or
11</script>");
Response.Write("<script> write out the correct clsid for the respective
version </script>");
}

roughly
--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------



DavidE said:
Hi Alvin,
Thanks for your answer.
I don't understand your solution because the function that check the OWC
version is in the client side and response.write is in the server side which
execute before the client side so how can I use sever side to display an
object if I have to write the object version in the response.write statement
and the object version depend on the client side function which execute last
?
I hope I'm clear.
A little example may help me to understand what you mean.

All the best,
David

Alvin Bruney - ASP.NET MVP said:
conditionally write it out to the screen using the response.write object
response.write<"clsid" etc

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------



DavidE said:
Hi Alvin,
I found your code. I don't need to download because I use the intranet
and
I
just use the lines that indicate the client office version
<script language="vbscript">

Sub CheckForOWC()
Dim objOWC
on error resume next
Set objOWC = CreateObject("OWC10.Chartspace")
if(objOWC.MajorVersion < 10) then
'here I have to set the object classid to
CLSID:0002E500-0000-0000-C000-000000000046 (for office 2000)

else
'here I have to set the object classid to
CLSID:0002E55D-0000-0000-C000-000000000046 (for office xp,2003)

end if
End Sub
</script>
after that script I have this html:
<body >
<div>
<table align="right" border="1" width="100%" >
<objec! classid="CLSID:0002E500-0000-0000-C000-000000000046"
id="ChartSpace1" style="HEIGHT: 410; WIDTH: 100%" VIEWASTEXT></object>
</table>
</div>
</body >

I don't know how to tie the CheckForOWC() procedure result to the object
that declared in html section.In other words, How can I change the object
classid that is declared in the html section with the result of CheckForOWC()
that declared in the script section ?

Thanks for your help,
David


:

You need to write a sniffer routine, there is code in this newsgroup that i
have provided early this year or last year - if you search the
archives
that
will sniff out the client version.

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------



Hi,
I need to know the office version of the client to use the right
component.
I use OWC(Office Web Component) and there is differences between the
versions.
In office 2000:classid=CLSID:0002E500-0000-0000-C000-000000000046
In office 2003:classid=CLSID:0002E55D-0000-0000-C000-000000000046
In the source it looks like this (html / asp) :
<OBJEC! id=ChartSpace1 style="WIDTH: 100%; HEIGHT: 350px"
classid=CLSID:0002E500-0000-0000-C000-000000000046>

Thanks
David
 
D

DavidE

Thanks Alvin,
I tried the code below and it works good on office 2003 but not on office
2000 because the "on error Resume Next" doesn't work in this code.
Do you know why ?

<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>

<BODY >
<%
response.Write "<script LANGUAGE='vbscript'> on error resume next </script>"
response.Write "<script LANGUAGE='vbscript'> Set objOWC =
CreateObject(""OWC10.Chartspace"") </script>"
response.Write "<script LANGUAGE='vbscript'> if (objOWC is nothing) then
msgbox ""Can not create OWC10.Chartspace"" </script>"
response.Write "<script LANGUAGE='vbscript'> if not (objOWC is nothing)
then msgbox objOWC.MajorVersion </script>"
%>

</BODY>
</HTML>

Thanks,
David



Alvin Bruney - ASP.NET MVP said:
version is in the client side and response.write is in the server side which
execute before the client side
It works the opposite way.

The black book has a more in-depth example but the idea is
in your page load routine

if !Page.Ispostback
{
Response.Write("<script> create an owc instance here and test it for null
</script>");
Response.Write("<script> if it is not null, then test for version 0,10 or
11</script>");
Response.Write("<script> write out the correct clsid for the respective
version </script>");
}

roughly
--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------



DavidE said:
Hi Alvin,
Thanks for your answer.
I don't understand your solution because the function that check the OWC
version is in the client side and response.write is in the server side which
execute before the client side so how can I use sever side to display an
object if I have to write the object version in the response.write statement
and the object version depend on the client side function which execute last
?
I hope I'm clear.
A little example may help me to understand what you mean.

All the best,
David

Alvin Bruney - ASP.NET MVP said:
conditionally write it out to the screen using the response.write object
response.write<"clsid" etc

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------



Hi Alvin,
I found your code. I don't need to download because I use the intranet and
I
just use the lines that indicate the client office version
<script language="vbscript">

Sub CheckForOWC()
Dim objOWC
on error resume next
Set objOWC = CreateObject("OWC10.Chartspace")
if(objOWC.MajorVersion < 10) then
'here I have to set the object classid to
CLSID:0002E500-0000-0000-C000-000000000046 (for office 2000)

else
'here I have to set the object classid to
CLSID:0002E55D-0000-0000-C000-000000000046 (for office xp,2003)

end if
End Sub
</script>
after that script I have this html:
<body >
<div>
<table align="right" border="1" width="100%" >
<objec! classid="CLSID:0002E500-0000-0000-C000-000000000046"
id="ChartSpace1" style="HEIGHT: 410; WIDTH: 100%" VIEWASTEXT></object>
</table>
</div>
</body >

I don't know how to tie the CheckForOWC() procedure result to the object
that declared in html section.In other words, How can I change the object
classid that is declared in the html section with the result of
CheckForOWC()
that declared in the script section ?

Thanks for your help,
David


:

You need to write a sniffer routine, there is code in this newsgroup
that i
have provided early this year or last year - if you search the archives
that
will sniff out the client version.

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------



Hi,
I need to know the office version of the client to use the right
component.
I use OWC(Office Web Component) and there is differences between the
versions.
In office 2000:classid=CLSID:0002E500-0000-0000-C000-000000000046
In office 2003:classid=CLSID:0002E55D-0000-0000-C000-000000000046
In the source it looks like this (html / asp) :
<OBJEC! id=ChartSpace1 style="WIDTH: 100%; HEIGHT: 350px"
classid=CLSID:0002E500-0000-0000-C000-000000000046>

Thanks
David
 
A

Alvin Bruney - ASP.NET MVP

i don't see anything immediately wrong. maybe someone else can glance it

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------



DavidE said:
Thanks Alvin,
I tried the code below and it works good on office 2003 but not on office
2000 because the "on error Resume Next" doesn't work in this code.
Do you know why ?

<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>

<BODY >
<%
response.Write "<script LANGUAGE='vbscript'> on error resume next
response.Write "<script LANGUAGE='vbscript'> Set objOWC =
CreateObject(""OWC10.Chartspace"") </script>"
response.Write "<script LANGUAGE='vbscript'> if (objOWC is nothing) then
msgbox ""Can not create OWC10.Chartspace"" </script>"
response.Write "<script LANGUAGE='vbscript'> if not (objOWC is nothing)
then msgbox objOWC.MajorVersion </script>"
%>

</BODY>
</HTML>

Thanks,
David



Alvin Bruney - ASP.NET MVP said:
version is in the client side and response.write is in the server side which
execute before the client side
It works the opposite way.

The black book has a more in-depth example but the idea is
in your page load routine

if !Page.Ispostback
{
Response.Write("<script> create an owc instance here and test it for null
</script>");
Response.Write("<script> if it is not null, then test for version 0,10 or
11</script>");
Response.Write("<script> write out the correct clsid for the respective
version </script>");
}

roughly
--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------



DavidE said:
Hi Alvin,
Thanks for your answer.
I don't understand your solution because the function that check the OWC
version is in the client side and response.write is in the server side which
execute before the client side so how can I use sever side to display an
object if I have to write the object version in the response.write statement
and the object version depend on the client side function which
execute
last
?
I hope I'm clear.
A little example may help me to understand what you mean.

All the best,
David

:

conditionally write it out to the screen using the response.write object
response.write<"clsid" etc

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------



Hi Alvin,
I found your code. I don't need to download because I use the
intranet
and
I
just use the lines that indicate the client office version
<script language="vbscript">

Sub CheckForOWC()
Dim objOWC
on error resume next
Set objOWC = CreateObject("OWC10.Chartspace")
if(objOWC.MajorVersion < 10) then
'here I have to set the object classid to
CLSID:0002E500-0000-0000-C000-000000000046 (for office 2000)

else
'here I have to set the object classid to
CLSID:0002E55D-0000-0000-C000-000000000046 (for office xp,2003)

end if
End Sub
</script>
after that script I have this html:
<body >
<div>
<table align="right" border="1" width="100%" >
<objec! classid="CLSID:0002E500-0000-0000-C000-000000000046"
id="ChartSpace1" style="HEIGHT: 410; WIDTH: 100%"
VIEWASTEXT> said:
</table>
</div>
</body >

I don't know how to tie the CheckForOWC() procedure result to the object
that declared in html section.In other words, How can I change the object
classid that is declared in the html section with the result of
CheckForOWC()
that declared in the script section ?

Thanks for your help,
David


:

You need to write a sniffer routine, there is code in this newsgroup
that i
have provided early this year or last year - if you search the archives
that
will sniff out the client version.

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------



Hi,
I need to know the office version of the client to use the right
component.
I use OWC(Office Web Component) and there is differences
between
the
versions.
In office 2000:classid=CLSID:0002E500-0000-0000-C000-000000000046
In office 2003:classid=CLSID:0002E55D-0000-0000-C000-000000000046
In the source it looks like this (html / asp) :
<OBJEC! id=ChartSpace1 style="WIDTH: 100%; HEIGHT: 350px"
classid=CLSID:0002E500-0000-0000-C000-000000000046>

Thanks
David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top