EvilZone

Programming and Scripting => .NET Framework => : pyte December 13, 2012, 03:58:57 AM

: Copying specific data from a word doc to excel
: pyte December 13, 2012, 03:58:57 AM

Trying to automate a CV selection process so im trying to fetch data from a word   document targeting specific qualifications and experience.
below is a VBA code that doesn't quite deliver...

:
Sub Test()
    Const wdFileName As String = "C:\Users\Desktop\emailexpottest.doc"
    Dim wdApp As Object
    Dim wdDoc As Object
    Dim Sh As Worksheet
    Set wdApp = CreateObject("Word.Application")
    Set wdDoc = wdApp.Documents.Open(test1)
    Set Sh = Worksheets("Sheet1")
    Sh.Activate
    Sh.Range("A1").Select
    wdDoc.Tables(1).Select
    wdApp.Selection.Copy
    ActiveSheet.Paste Link:=True
    wdApp.Quit
End Sub


Kindly advice on what amendments to make.