Hi All, Don't know if this is the right newsgroup but I need the ability to read the contents of a word document into a string using C# (but any .NET examples would be great) Please help. Thanks,
Hi All, Don't know if this is the right newsgroup but I need the ability to read the contents of a word document into a string using C# (but any .NET examples would be great) Please help. Thanks,
Hi Tim, Well, taken absolutely literally, that would go something like this (off the top of my head, so syntax errors are possible!) word.document doc = wdapp.ActiveDocument; string s = doc.Content.Text this will capture all TEXT in the body of the document - not headers, footers, footnotes, anything in text boxes, etc. If you need that, then you also need to loop through the StoryRanges. For more on that, including sample (VBA) code, look up StoryRange, StoryRanges and all related topics in the object model Help. Note that this is most decidedly NOT the best place to ask, as this group is aimed at end-users :-) One of the office.developer newsgroups would be more appropriate or, at a pinch a word.vba group. Cindy Meister INTER-Solutions, Switzerland http://www.**--****.com/ (last update Jun 8 2004) http://www.**--****.com/ This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-mail :-)
1.Reading a word document into a string
Hi All, I need to be able to read a word document into a string, can someone post some sample code or point me in the right direction please. I've googled on this for ages and can't turn up anything useful. Many thanks,
2.Reading Text from Word Document into LotusScript String?
Hi, Can anyone give me some LotusScript code examples to help me out with this problem? - I need to be able to open a MS Word document for reading. - I would like to be able to read in a line of text from the Word document into a LotusScript string. I only need the text and not concerned about formatting such as bold, italics, etc. - I was hoping to go through each line till the end of the Word document. Help is greatly appreciated. Thanks in advance.
3.How to read word from a string
Greetings, I need to read words from a scalar variable and be able to continue to the next word Mike
4.!! Reading character by character from a string and check it
hi folks, i have a table, with 11 rows in a word doc. i need to read Names and Dates from a Sentence. Names are all in UPPERCASE as STEVE. Dates are in different formats. i need a routine to read character by character and check if Uppercase, using UCase or if Lowercase using LCase or any other character. Using the same routine i need to recognise a date from the sentence. These are then displayed in text boxes in visual basic. In this table there is the following characters: text, integers, spaces " " and foward slashes /. any comment appreciated. i need to start from somewhere! Regards, Steve
I'm trying to find a specific table in a Word 2002 document by reading the string in its first cell and comparing it to a fixed string. The code looks like this: Dim myTest as string Dim myTable as Table For tableNo = 1 To totalTables Set myTable = ActiveDocument.Tables(tableNo) myTest = myTable.Cell(1, 1).Range.Text If myTest = "SomeUniqueWord" Then blah, blah The problem is that myTest contains the text from the table plus a couple of strange characters at the end that show up as rectangles on my screen. Nothing I have tried seems to get rid of those funny characters or allow me to make a match on it. I've tried trim(), as well as other string cleaner functions and I've tried StrComp() too. Either it won't match or I get a type mismatch. Is there some way to get just the visible characters from the cell? Thanks, Mark
6. string operation, How to get each word from a string
7. function converting a string to string with first letter of each word - capital
Users browsing this forum: No registered users and 43 guest