Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.word.newusers
|
|||
|
|||
![]()
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, |
#2
![]()
Posted to microsoft.public.word.newusers
|
|||
|
|||
![]()
Hi Tim,
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) 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://homepage.swissonline.ch/cindymeister (last update Jun 8 2004) http://www.word.mvps.org This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-mail :-) |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
The WordPerfect "Reveal Codes" method is so much easier to use. | Microsoft Word Help | |||
Does Word have a QuickCorrect/Quick Word option like WordPerfect? | New Users | |||
Word2000 letterhead merge | Mailmerge | |||
is word perfect compatible with office word? | Microsoft Word Help | |||
Macros - Keyboard Commands | Microsoft Word Help |