Microsoft Word - How to Populate a word document with data from other word document

Asked By Ben Kingsworth on 01-Jun-12 02:13 PM
Hi,

  How can we populate a word document (2007) with data (tables, paragraph) from other word document (source doc) conditionally using VBA userforms.  Depending on the user input recorded thru forms, the document should be populated from the ohter document (source document).

  Please let me know, how to achieve this. Thanks
Jitendra Faye replied to Ben Kingsworth on 04-Jun-12 06:02 AM
After searching I got this solution, hope this will help you.

Public Sub accessTable()

Set appWD = CreateObject("Word.Application")

appWD.Documents.Open Filename:="C:\WordTableData.doc", _

ConfirmConversions:=False, ReadOnly:=False, AddToRecentFiles:=False,

PasswordDocument:="", PasswordTemplate:="", Revert:=False, _

WritePasswordDocument:="", WritePasswordTemplate:="", Format:= _

wdOpenFormatAuto

x = appWD.ActiveDocument.Tables(1).Rows(1).Cells(1)

MsgBox (x)

appWD.Quit

End Sub


Reference from-

http://www.ehow.com/how_6873235_extract-tables-using-excel-vba.html