| Author |
Message |
B Deepak
Guest
|
Posted:
Mon Oct 24, 2005 8:51 am Post subject:
how cud I get the word document content which is stored in o |
|
|
Hi,
I have to acess the word document content which is stored in sharepoint
site. Anybody having any idea abt how to access content programmatically?
Note: I am using SQL database engine as a db store.
Thanks in Advance,
Deepak |
|
| Back to top |
|
 |
bsimser
Joined: 22 Jul 2005
Posts: 175
|
Posted:
Mon Oct 24, 2005 8:51 am Post subject:
Re: how cud I get the word document content which is stored |
|
|
Hi there,
The content on the site has really little to do with SharePoint (or SQL
for that matter) other than accessing the files.
Once you access the file you'll have a binary stream to work with. From
there, you'll need to use the Word COM library to do anything with the
contents of the document. If the document is in Xml format (or can be
converted to Xml, Word can save this way) then you can just use the
WordML schemas and treat the binary stream as a regular XmlDocument.
So you'll need to get the document (use the OpenBinary method on the
SPFile class) then use the Word COM library to work with it. If it's
Xml, use OpenBinary but convert it to a string first with something like
Encoding.Default.GetString(input). Once it's a string you can use the
LoadXml method on an XmlDocument object.
--
Bil Simser
SharePoint MVP, BSc., MCSD
Calgary, Alberta
http://weblogs.asp.net/bsimser
"B Deepak" <deepak_badki@persistent.co.in> wrote in message
news:#Xz3#RF2FHA.2348@TK2MSFTNGP15.phx.gbl:
| Quote: | Hi,
I have to acess the word document content which is stored in sharepoint
site. Anybody having any idea abt how to access content
programmatically?
Note: I am using SQL database engine as a db store.
Thanks in Advance,
Deepak |
|
|
| Back to top |
|
 |
B Deepak
Guest
|
Posted:
Mon Oct 24, 2005 8:51 am Post subject:
Re: how cud I get the word document content which is stored |
|
|
Hi Bil,
I am using sharepoint web service calls not sharepoint native APIs. And as
per my knowledge, we can not use native APIs on machine other than SP
server machine. That means I can not use SPFile class from remote machine.
Please let me know any other tech. to access word doc.
Thanks,
Deepak
"Bil Simser [SPS MVP]" <bsimser@shaw.ca> wrote in message
news:u5YHq1F2FHA.268@TK2MSFTNGP09.phx.gbl...
| Quote: | Hi there,
The content on the site has really little to do with SharePoint (or SQL
for that matter) other than accessing the files.
Once you access the file you'll have a binary stream to work with. From
there, you'll need to use the Word COM library to do anything with the
contents of the document. If the document is in Xml format (or can be
converted to Xml, Word can save this way) then you can just use the WordML
schemas and treat the binary stream as a regular XmlDocument.
So you'll need to get the document (use the OpenBinary method on the
SPFile class) then use the Word COM library to work with it. If it's Xml,
use OpenBinary but convert it to a string first with something like
Encoding.Default.GetString(input). Once it's a string you can use the
LoadXml method on an XmlDocument object.
--
Bil Simser
SharePoint MVP, BSc., MCSD
Calgary, Alberta
http://weblogs.asp.net/bsimser
"B Deepak" <deepak_badki@persistent.co.in> wrote in message
news:#Xz3#RF2FHA.2348@TK2MSFTNGP15.phx.gbl:
Hi,
I have to acess the word document content which is stored in sharepoint
site. Anybody having any idea abt how to access content
programmatically?
Note: I am using SQL database engine as a db store.
Thanks in Advance,
Deepak
|
|
|
| Back to top |
|
 |
bsimser
Joined: 22 Jul 2005
Posts: 175
|
Posted:
Mon Oct 24, 2005 4:51 pm Post subject:
Re: how cud I get the word document content which is stored |
|
|
There's no web services for retrieving the content of documents just
because it's regular HTTP that you can use for this.
Check out this article to get you started on using the request and
respons classes. Once you've got the document contents in memory you'll
be able to manipulate it using the Word object model (or XmlDocument if
it's in xml form)
http://www.developerfusion.co.uk/show/4637/2/
--
Bil Simser
SharePoint MVP, BSc., MCSD
Calgary, Alberta
http://weblogs.asp.net/bsimser
"B Deepak" <deepak_badki@persistent.co.in> wrote in message
news:OV90l3G2FHA.3816@TK2MSFTNGP14.phx.gbl:
| Quote: | Hi Bil,
I am using sharepoint web service calls not sharepoint native APIs. And
as
per my knowledge, we can not use native APIs on machine other than SP
server machine. That means I can not use SPFile class from remote
machine.
Please let me know any other tech. to access word doc.
Thanks,
Deepak
"Bil Simser [SPS MVP]" <bsimser@shaw.ca> wrote in message
news:u5YHq1F2FHA.268@TK2MSFTNGP09.phx.gbl...
Hi there,
The content on the site has really little to do with SharePoint (or
SQL
for that matter) other than accessing the files.
Once you access the file you'll have a binary stream to work with.
From
there, you'll need to use the Word COM library to do anything with the
contents of the document. If the document is in Xml format (or can be
converted to Xml, Word can save this way) then you can just use the
WordML
schemas and treat the binary stream as a regular XmlDocument.
So you'll need to get the document (use the OpenBinary method on the
SPFile class) then use the Word COM library to work with it. If it's
Xml,
use OpenBinary but convert it to a string first with something like
Encoding.Default.GetString(input). Once it's a string you can use the
LoadXml method on an XmlDocument object.
--
Bil Simser
SharePoint MVP, BSc., MCSD
Calgary, Alberta
http://weblogs.asp.net/bsimser
"B Deepak" <deepak_badki@persistent.co.in> wrote in message
news:#Xz3#RF2FHA.2348@TK2MSFTNGP15.phx.gbl:
Hi,
I have to acess the word document content which is stored in
sharepoint
site. Anybody having any idea abt how to access content
programmatically?
Note: I am using SQL database engine as a db store.
Thanks in Advance,
Deepak
|
|
|
| Back to top |
|
 |
|
|
|
|