Click here to Skip to main content
15,902,938 members
Home / Discussions / C#
   

C#

 
GeneralRe: Picturebox tooltips Pin
Gareth H12-Mar-07 6:47
Gareth H12-Mar-07 6:47 
GeneralRe: Picturebox tooltips Pin
M-Hall12-Mar-07 7:19
M-Hall12-Mar-07 7:19 
GeneralRe: Picturebox tooltips Pin
Gareth H13-Mar-07 0:26
Gareth H13-Mar-07 0:26 
QuestionSession variable problem Pin
Icarus12312-Mar-07 2:36
Icarus12312-Mar-07 2:36 
AnswerRe: Session variable problem Pin
Sylvester george12-Mar-07 3:34
Sylvester george12-Mar-07 3:34 
QuestionEliminate Column Headers as RowCount in DataGridView Pin
SakthiSurya12-Mar-07 2:28
SakthiSurya12-Mar-07 2:28 
QuestionSimple webservice consumed by php problem, maby namespace problem? Pin
Snowjim12-Mar-07 2:24
Snowjim12-Mar-07 2:24 
QuestionHow to Load a word doc from database into a _document doc Pin
Kuba_B12-Mar-07 0:59
Kuba_B12-Mar-07 0:59 
Hi, I'm working tidying up (and getting rid of) heaps of word documents we have in countless folders that have guidlines, documentation and so on. To do this I've created a searchable knowledge base. What I want to be able to do (for the short term) is take attached word docs, read the content and insert the text. Later on i might look at doing clever things with images and so on but this will do for now.

currently, I can do this when reading a local file using the code below:

<br />
		string DocToHtml(string docPath)<br />
		{<br />
			Microsoft.Office.Interop.Word.Application app=new Microsoft.Office.Interop.Word.Application();<br />
			app.Visible=false;<br />
			Object o=Missing.Value;<br />
			object docFile=docPath;<br />
			_Document doc=app.Documents.Open(ref docFile,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o);<br />
			<br />
			// just take the text and paste it into the description field.<br />
			// this will do in allowing searching.<br />
			returnString=doc.Content.Text.ToString();	<br />
<br />
			object t=true;<br />
			app.Quit(ref t,ref o,ref o);<br />
			<br />
			return returnString;<br />
		}<br />


That works as a tester, it just dumps the text into a string. fine by me for now. Next bit though, that is the bit I am having trouble with, is taking binary data from a database and using it in the same way as the _document doc etc bit above. I can load the data as a datareader;

SqlDataReader dr = command.ExecuteReader(); - gets me the data.

but don't know what to do with it then.


Any suggestions please?

Thanks!

Kuba
AnswerRe: How to Load a word doc from database into a _document doc Pin
Sylvester george12-Mar-07 3:43
Sylvester george12-Mar-07 3:43 
GeneralRe: How to Load a word doc from database into a _document doc Pin
Kuba_B13-Mar-07 0:56
Kuba_B13-Mar-07 0:56 
QuestionGetting temperatures Pin
sharpiesharpie12-Mar-07 1:38
sharpiesharpie12-Mar-07 1:38 
AnswerRe: Getting temperatures Pin
Scott Dorman12-Mar-07 4:04
professionalScott Dorman12-Mar-07 4:04 
QuestionA question about GDI release [modified] Pin
rockinfog12-Mar-07 1:32
rockinfog12-Mar-07 1:32 
QuestionDialing Modem... Pin
Saeedses12-Mar-07 0:29
Saeedses12-Mar-07 0:29 
QuestionConvert Pin
netvano12-Mar-07 0:53
netvano12-Mar-07 0:53 
Questiongetting data from an sql database in a datagrid Pin
Keshav V. Kamat11-Mar-07 23:21
Keshav V. Kamat11-Mar-07 23:21 
AnswerRe: getting data from an sql database in a datagrid Pin
rvlemmings12-Mar-07 1:31
rvlemmings12-Mar-07 1:31 
Questionproxy pac in .NET 2.0 C# Pin
drifters11-Mar-07 21:49
drifters11-Mar-07 21:49 
AnswerRe: proxy pac in .NET 2.0 C# Pin
Scott Dorman12-Mar-07 4:00
professionalScott Dorman12-Mar-07 4:00 
QuestionWi-Fi Pin
kikka11-Mar-07 21:16
professionalkikka11-Mar-07 21:16 
QuestionCapture LogOff event Pin
MPR200611-Mar-07 21:12
MPR200611-Mar-07 21:12 
AnswerRe: Capture LogOff event Pin
Stefan Troschuetz11-Mar-07 22:08
Stefan Troschuetz11-Mar-07 22:08 
GeneralRe: Capture LogOff event Pin
MPR200611-Mar-07 22:13
MPR200611-Mar-07 22:13 
AnswerRe: Capture LogOff event Pin
pbraun12-Mar-07 3:52
pbraun12-Mar-07 3:52 
Questionc# assemblies app.config [modified] Pin
christalin11-Mar-07 19:45
christalin11-Mar-07 19:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.