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
Printable View
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
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
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 "
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
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
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
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