Hi All,
I merged 2 documents. One Word and another Excel. I used Bookmarks on my Word doc. Everything works fine.
this is my code:
Dim myWB As Excel.Workbook
Private Sub cmdUpdtAmt_Click()
Set myWB = GetObject("G:\test\ExcelCalculation.xlsm")
Selection.GoTo What:=wdGoToBookmark, Name:="AmtDue"
Selection.TypeText (myWB.Sheets("PayHist").Range("Amount_Due"))
Set myWB = Nothing
Set myWB = GetObject("G:\test\ExcelCalculation.xlsm")
Selection.GoTo What:=wdGoToBookmark, Name:="DaysOverdue"
Selection.TypeText (myWB.Sheets("PayHist").Range("Payment_Overdue"))
Set myWB = Nothing
End Sub
My concern is i have almost 10 pages...how can I make the "AmtDue" and the "DaysOverdue" spread in all over the WORD Document (10 pages) on specific places? Do i still have to use Bookmarks or not?cause bookmark is one per spot i wish it can be duplicated...
Thanks!!!
I merged 2 documents. One Word and another Excel. I used Bookmarks on my Word doc. Everything works fine.
this is my code:
Dim myWB As Excel.Workbook
Private Sub cmdUpdtAmt_Click()
Set myWB = GetObject("G:\test\ExcelCalculation.xlsm")
Selection.GoTo What:=wdGoToBookmark, Name:="AmtDue"
Selection.TypeText (myWB.Sheets("PayHist").Range("Amount_Due"))
Set myWB = Nothing
Set myWB = GetObject("G:\test\ExcelCalculation.xlsm")
Selection.GoTo What:=wdGoToBookmark, Name:="DaysOverdue"
Selection.TypeText (myWB.Sheets("PayHist").Range("Payment_Overdue"))
Set myWB = Nothing
End Sub
My concern is i have almost 10 pages...how can I make the "AmtDue" and the "DaysOverdue" spread in all over the WORD Document (10 pages) on specific places? Do i still have to use Bookmarks or not?cause bookmark is one per spot i wish it can be duplicated...
Thanks!!!