Hi
i want to count charecters and lines from a word file
where i'll select the file for which i want to count charecters and lines through vb6
could some one help me pls its urgent
Printable View
Hi
i want to count charecters and lines from a word file
where i'll select the file for which i want to count charecters and lines through vb6
could some one help me pls its urgent
VB Code:
Dim appWord As New Word.Application Dim docWord As New Word.Document appWord.Documents.Open App.Path & "\new.doc" Set docWord = appWord.Documents(1) MsgBox docWord.Content.ComputeStatistics(wdStatisticCharacters) MsgBox docWord.Content.ComputeStatistics(wdStatisticWords) MsgBox docWord.Content.ComputeStatistics(wdStatisticLines) MsgBox docWord.Content.ComputeStatistics(wdStatisticParagraphs) MsgBox docWord.Content.ComputeStatistics(wdStatisticPages) docWord.Close (0) appWord.Quit Set docWord = Nothing Set appWord = Nothing
can i open multiple files and take the count of charecters..?
where can i download microsoft word object library 9.0
the library cannot be downloaded, neither redistributed
but it is giving me an error
and the library is not available into the reference also
how should i do it
install office
office 97 is already installed on the machine
but still it is giving an error
try using late binding
VB Code:
Option Explicit Public objWord As Object 'instead of Word.Application Public wd As Object 'instead of Word.Document Private Sub Command1_Click() If objWord Is Nothing Then Set objWord = CreateObject("Word.Application") Else Set objWord = GetObject(, "Word.Application") End If DoEvents Set wd = objWord.Documents.Open("c:\Test.doc") 'here u can do stuff with the document 'using the wd object 'adding some text to it wd.ActiveWindow.Selection.TypeText "ABCDEFGH peet was here ! :-)" 'when finished manipulating the document, u can show it To the user objWord.Visible = True 'quit word If Not (wd Is Nothing) Then Set wd = Nothing If Not (objWord Is Nothing) Then objWord.Application.Quit If Not (objWord Is Nothing) Then Set objWord = Nothing End Sub