I am writing a VB 6.0 application where in I want to copy data from one word document to another.I am able to open the source word document and count the number of tables present in the document, but I am unable to select any data present in that word document.
I get the error when I reach the the statement that is in bold.Code:Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) Public wdApp As New Word.Application Public wddoc As Word.Document Public Sub OpenSrcWord() Dim strSCOId As String wdApp.Documents.Add frmStoryBoard.txtSrcWordDoc.Text, , , True Set wddoc = wdApp.ActiveDocument ActiveDocument.Tables(1).Cell(2, 1).Select strSCOId = Selection.Text End Sub
Also I have used the same code in my another application which I had developed sometime back; where it works fine.
I have selected the word object library reference in the Project.
Any help in this regard would be appreciated !




Reply With Quote