I'm Having troubles across Excel and Word and wonder if anyone can help. I have a table in Excel populated with data and I wish to pass a specific cell value to a bookmark in word. I have sucessfully transfered a paragraph, but cannot get a single cell value to appear to it's bookmark. Here's my code
Public Sub Wap()
Const wdWindowStateMaximize As Integer = 1
Const wdNormalView As Integer = 3
Const wdAlignParagraphCenter As Integer = 1
Const wdPageFitFullPage As Integer = 1
Const wdGoToLine As Integer = 3
Dim WordDoc As Object
Set WordApp = CreateObject("Word.Application"
With WordApp
.Visible = True
.WindowState = wdWindowStateMaximize
WordApp.Documents.Open Filename:="C:\....Path....\test template.dot", _
ReadOnly:=False
Set WordDoc = .ActiveDocument
End With
WordDoc.ActiveWindow.View = wdNormalView
Selection.Goto What:=wdwdGoToBookmark, Name:="NAME"
Selection.InsertAfter Sheet1.Range("H10"
End Sub
I get an error message stating the bookmark cannot be found against the GotO statement, yet I know it's there in the Word template. Any ideas anyone??
Public Sub Wap()
Const wdWindowStateMaximize As Integer = 1
Const wdNormalView As Integer = 3
Const wdAlignParagraphCenter As Integer = 1
Const wdPageFitFullPage As Integer = 1
Const wdGoToLine As Integer = 3
Dim WordDoc As Object
Set WordApp = CreateObject("Word.Application"
With WordApp
.Visible = True
.WindowState = wdWindowStateMaximize
WordApp.Documents.Open Filename:="C:\....Path....\test template.dot", _
ReadOnly:=False
Set WordDoc = .ActiveDocument
End With
WordDoc.ActiveWindow.View = wdNormalView
Selection.Goto What:=wdwdGoToBookmark, Name:="NAME"
Selection.InsertAfter Sheet1.Range("H10"
End Sub
I get an error message stating the bookmark cannot be found against the GotO statement, yet I know it's there in the Word template. Any ideas anyone??