I have the code to write from an excel sheet to a word document, but I have a couple of buttons in which I want to write in the same word document.
Thats the code for command button 1, but i have a second command button in which I want a certain range to paste in the same BOM word document. Can anyone help? Thank You
Code:
Dim wordApp As Object
Dim fNameAndPath As String
fNameAndPath = "C:\Documents and Settings\Gerard\My Documents\BOM.doc"
Set wordApp = CreateObject("Word.Application")
wordApp.Documents.Open (fNameAndPath)
wordApp.Visible = True
Worksheets("Sheet3").Range("A1:S16").Copy
If Sheets("Sheet3").Activate Then
wordApp.Selection.PasteSpecial
End If
Thats the code for command button 1, but i have a second command button in which I want a certain range to paste in the same BOM word document. Can anyone help? Thank You