Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

How to access the content of a Word file from C#?


  • Please log in to reply

#1
handymulia

handymulia

    New Member

  • Member
  • Pip
  • 4 posts
Hi experts,

I need to access the content of a given MS Word file.

For example the content is like this:
abcdefg
xyz
123

The file has 3 lines, and I need to get the 2nd line's value, in this case "xyz".

Does anybody know how to do that? I have added the library and tried to do it however it just can't seem to work. Really need an expert's help... :tazz:


Thanks alot,

Handy
  • 0

Advertisements


#2
stu_design

stu_design

    Member

  • Member
  • PipPipPip
  • 217 posts
heres something to tease ur mind

create a sub

Sub Macro2()

    Selection.MoveDown Unit:=wdLine, Count:=1
    Selection.MoveRight Unit:=wdCharacter, Count:=3, Extend:=wdExtend
    Dim x As String
    x = Selection.Text
    MsgBox x

End Sub

now just call the sub in ur code

Call Macro2

im guessing u can already open the word document from watevr office ttoo(excel, word)

if not post back and ill help u line by line

wat office u usinm?
from wat office to word?

Stu design

Edited by stu_design, 26 May 2005 - 12:28 PM.

  • 0

#3
handymulia

handymulia

    New Member

  • Topic Starter
  • Member
  • Pip
  • 4 posts
Hi man,

Thanks for replying! However do you know how to do that in C#?
I need to access a WORD file from C#


Thanks a lot..
  • 0

#4
stu_design

stu_design

    Member

  • Member
  • PipPipPip
  • 217 posts
sorry i do not
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP