Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » Registry & File Input / Output

Post new topic   Reply to topic
extracting text from word textbox
View previous topic :: View next topic  
Author Message
Silly Star
Newbie


Joined: 15 Jul 2005
Posts: 4

PostPosted: Jul 25th, 2005 12:19 AM    Post subject: extracting text from word textbox Reply with quote

Dear Helpers
i have been working on word Document files.
each document has same text format.
i m using the code below to extract text from it,



Code:

Dim sFileName As String 'Name of files within the folder will be stored
Dim i As Integer 'This will count the files read***
Dim wrd As Word.Application
Dim wrdCount As Long 'Number of characters within the file
   'Get the first file with extension "DOC" ***
            sFileName = Dir$("C:\Virology\*.DOC") '***
   Do While sFileName <> "" '***
         Set wrd = New Word.Application 'Create obj of word application
         wrd.Visible = False
         wrd.Documents.Open "C:\Virology\" & sFileName
         wrdCount = wrd.Documents(1).Characters.Count
       Text1.Text = Text1.Text & vbCrLf & i & wrd.Documents(1).Range(0, wrdCount).Text
         wrd.Documents(1).Close
         Set wrd = Nothing
       sFileName = Dir$ '***
       i = i + 1
   Loop



This works good for all the characters in the document but the problem rises when word textbox appears in the document.
Back to top
View user's profile Send private message Yahoo Messenger
RoofRabbit
Regular


Joined: 06 Jul 2005
Posts: 95
Location: Lenoir, NC USA

PostPosted: Aug 1st, 2005 03:15 AM    Post subject: Reply with quote

Start with Text1.Text="" before your code starts adding to it.
_________________
Website - [link]
Back to top
View user's profile Send private message Visit poster's website ICQ Number
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » Registry & File Input / Output All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic