Members

Technology Zones

Articles

Hosted By

MaximumASP

Info

read the word document line by line thru visual basic 6.0

Last post 04-30-2008 12:25 PM by Jugatsu. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 04-29-2008 12:42 PM

    • vivekgrs
    • Top 150 Contributor
    • Joined on 02-01-2006
    • Fanatic Member
    • Points 1,495

    read the word document line by line thru visual basic 6.0

    hi friends,

              i want to read the word document line by line thru visual basic 6.0. i  can able 2 read the data  line by line in text file .but i cant able 2 read it in word document. can anyone help me regarding this

     

    regards

    vivek

    • Post Points: 10
  • 04-30-2008 12:25 PM In reply to

    • Jugatsu
    • Top 500 Contributor
    • Joined on 02-15-2006
    • Member
    • Points 290

    Re: read the word document line by line thru visual basic 6.0

    Hi,

    Try

    'Create the Word Object
    Dim objWord As Word.Application
    Dim objDocContent As Word.Range
    Dim sFileName as String

    sFileName = App.Path & "\" & "Test.doc"

    Set objWord = New Word.Application

    'Use to show or hide Word from the users view
    objWord.Visible = True

    'Open the Document
    objWord.Documents.Open sFileName

    'Get the contents
    Set objDocContent = objWord.ActiveDocument.Content

    'Put the contents into a textbox
    Text1.text = objDocContent

    'Quit Word
    objWord.Quit

    'Destroy the object
    Set objWord = Nothing

    • Post Points: 5
Page 1 of 1 (2 items)