I want to exporting some data from Excel 2010 to specific bookmarks in a Word document (template)
The first bookmark already exist in the Word document. The next couple of bookmarks do not exist already because the are different each time. (user can decide by a macro buttons in excel with bookmarks should be added.)
Starting my marco in excel, it opens the document and it finds the basic bookmark. The cursor is put on the right place. But then I can't figure out what should be the code to add a vbCrLF to get the cursor on the next blank line in that Word document.
I'am trying differt code with Chr10 or vbCrLF on the same code row or a new one but I can't find the solution.
Complete function code, so far:
Dim wrdApp As Object
Dim wrdDoc As Object
Dim oRng As Object
Dim wdDoc As Word.Document
On Error Resume Next
Set wrdApp = GetObject(, "Word.Application")
If Err Then
Set wrdApp = CreateObject("Word.Application")
End If
On Error GoTo 0
wrdApp.Visible = True
Set wrdDoc = wrdApp.Documents.Add(Template:="C:\local\DD.dotx")
Set oRng = wrdDoc.Paragraphs(1).Range
With wrdApp
'.Documents.Open "C:\local\DD.dotx"
wrdApp.Selection.Goto What:=wdGoToBookmark, Name:="DD"
End With
End Sub
Does anybody know a solution for this?
Bookmarks