EvilZone

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

Title: Copying specific data from a word doc to excel
Post by: pyte on 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...

Code: [Select]
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.