Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
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