I want to develope VBA macro at excel due to export data to a spefic word documents with bookmarks. My Questions are: c#-1. I have one table and i sent it as unformated txt. c#-2. Also to choose between to word files where to sent the data:
The code that i have is :
Private Sub CommandButton1_Click()
Dim WordApp As Word.Application
Dim WordDoc As Word.Document
Set WordApp = New Word.Application
Set WordDoc = WordApp.Documents.Open("C:\Users\ChatzisavasK\Desktop\Offering\test\Test2.docx") `(Also i need to see if there is the possibility to choose *.docx )`
Range("a1:c10").Select `This work properly`
Selection.CopyPicture Appearance:=xlScreen, Format:=xlPicture
WordApp.Visible = True
WordApp.ActiveDocument.Bookmarks("offer").Select
Set objSelection = WordApp.Selection
objSelection.Paste
Range("F1").Select `this does not work`
Selection.PasteSpecial DataType:=2
WordApp.Visible = True
WordApp.ActiveDocument.Bookmarks("e1").Select
Set objSelection = WordApp.Selection
objSelection.Paste
End Sub