I'm using Ms2007
How to open a cpecific file MsWord( example- C:\Myw.doc) form Excel Vba and export(print) the content of specific cells(in Sheet of excel) in specific place in the MsWord
Printable View
I'm using Ms2007
How to open a cpecific file MsWord( example- C:\Myw.doc) form Excel Vba and export(print) the content of specific cells(in Sheet of excel) in specific place in the MsWord
It's easy. Just a quick question. Would that 'Specific place' in MS Word doc have a bookmark? If not then how will Excel decide which place to export?
Sid
Here is the code to open specfic word file
After I open the file I want to print the text in cells of excel example:vb Code:
Private Sub CommandButton1_Click() WObject End Sub Sub WObject() Dim Wd As Object Dim Doc As Object Set Wd = CreateObject("Word.Application") Set Doc = Wd.Documents.Open("C:\AAA\Test.docx") Wd.Visible = True End Sub
The Cell(1,1), cell(2,3) in word..
If the cells content "John" and "Tom" .. it will print in the Word sheet. "John" and "Tom"
I hope I'm clear
where do you want john and tom to print?
at the beginning, the end, in a table or at a specific position?
in specific position, but I don't know how to limit is this depend on mergin?
you have to have a criteria to find the correct position, this may be a bookmark, or to find certain text and put before / after or whatever, we can not help without knowing the criteria
Oky before this text " this un example to exprot from excel to word"
and thank you for help!
Can you upload your word file?
Sid
Here is the file.