L
Lee
I have an Excel add-in from which I can open a Word
template and insert info from the Excel workbook. I am
trying to insert AutoText that is saved in the template,
but I can't find the right syntax. This is what I have
written:
Dim WordApp As Word.Application
Set WordApp = CreateObject("word.application")
WordApp.Visible = True
With WordApp
Documents.Add Template:= _
"C:\Documents and Settings\all
users\Templates\rxtemptest.dot" _
, NewTemplate:=False, DocumentType:=0
WordApp.Selection.Goto what:=wdGoToBookmark,
Name:="PlaceMark"
WordApp.Selection.Insert("temp1").InsertAutoText
Where:=Selection.Range, _
RichText:=True
End With
What am I doing wrong?
template and insert info from the Excel workbook. I am
trying to insert AutoText that is saved in the template,
but I can't find the right syntax. This is what I have
written:
Dim WordApp As Word.Application
Set WordApp = CreateObject("word.application")
WordApp.Visible = True
With WordApp
Documents.Add Template:= _
"C:\Documents and Settings\all
users\Templates\rxtemptest.dot" _
, NewTemplate:=False, DocumentType:=0
WordApp.Selection.Goto what:=wdGoToBookmark,
Name:="PlaceMark"
WordApp.Selection.Insert("temp1").InsertAutoText
Where:=Selection.Range, _
RichText:=True
End With
What am I doing wrong?