texasalynn
Well-known Member
- Joined
- May 19, 2002
- Messages
- 8,458
I have this code but it is not working. It says that it can't find the bookmark, yet I have the bookmark on the Word document. I've looked at this but am not seeing why it doesn't work?
Thanks for taking a look
Code:
Private Sub SendPI_Form()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Dim MyWord As Object
'On Error GoTo Fixit
Set MyWord = CreateObject("Word.Application")
MyWord.ChangeFileOpenDirectory "S:\REPORTING ANALYSIS\Reporting Tools\Macros"
MyWord.Documents.Open Filename:="Temp Open Tops.doc"
MyWord.Visible = True
With MyWord.Selection
'Insert text into word document by user at bookmark (placeholders) locations
.Goto What:=wdGoToBookmark, Name:=RequestedBy
.TypeText Range("RequestedBy").Value
.Goto What:=wdGoToBookmark, Name:=Date
.TypeText Range("Date").Value
....more stuff
End Sub
Thanks for taking a look