|
-
Jul 14th, 2003, 03:18 AM
#1
Thread Starter
Addicted Member
how to access comments from a word file
Hi
how should i access the comments that are written at bottom of the word file and save it to a access database.
can any one help me pls
-
Jul 14th, 2003, 04:08 AM
#2
Fanatic Member
VB Code:
Dim appWord As New Word.Application
Dim docWord As New Word.Document
appWord.Documents.Open "e:\benoni's documenten\new.doc"
Set docWord = appWord.Documents(1)
MsgBox docWord.Comments(1).Range.Text
docWord.Close (0)
appWord.Quit
Set docWord = Nothing
Set appWord = Nothing
- Use the thread tools to Mark your Thread as Resolved when your question is answered.
- Please Rate my answers if they where helpful.
-
Jul 15th, 2003, 08:13 PM
#3
Thread Starter
Addicted Member
hi
it is not working
when i give the file name for which i want to see the comments
it is showing me an error as
" invalid outside procedure "
-
Jul 16th, 2003, 05:09 AM
#4
Fanatic Member
try this:
VB Code:
Private Sub Form_Load()
Dim appWord As New Word.Application
Dim docWord As New Word.Document
appWord.Documents.Open "e:\benoni's documenten\new.doc"
Set docWord = appWord.Documents(1)
MsgBox docWord.Comments(1).Range.Text
docWord.Close (0)
appWord.Quit
Set docWord = Nothing
Set appWord = Nothing
End Sub
- Use the thread tools to Mark your Thread as Resolved when your question is answered.
- Please Rate my answers if they where helpful.
-
Jul 16th, 2003, 07:57 PM
#5
Thread Starter
Addicted Member
Hi
i it is working but i am not satisfied as yet
what it d is it tracks for any first comment in the file and omits all the rest comments that are there in the file
what i want is it should go to the last line of the page and see if there is any comment on the last line
if there is then record the comment and save it to the database or else live it
-
Jul 17th, 2003, 04:23 AM
#6
Fanatic Member
replace this line:
VB Code:
MsgBox docWord.Comments(1).Range.Text
by this line:
VB Code:
Dim i As Integer
For i = 1 To docWord.Comments.Count
'write here your code to write the comments to the Database
MsgBox docWord.Comments(i).Range.Text
Next i
this shows you all the comments in a worddocument
- Use the thread tools to Mark your Thread as Resolved when your question is answered.
- Please Rate my answers if they where helpful.
-
Jul 18th, 2003, 12:49 AM
#7
Thread Starter
Addicted Member
Hi
that was very much help full
thanks
but on the last line of the document if there are two comments one in between the line and one at the end of the line.
And i just want to read the comment that is at the end of line of the documents last line
is that possible help pls
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|