I have a problem using this bit of code the second time
It is being used to select an autotext in a .dot file and then using it in a .doc file..
The first time running the code is works perfectly, but the second time it generates an error:
can't find requested server..
this is the bit of code:
Set oWord = New Word.Application
With oWord
.Documents.Open (mFilePath & "Inventerra.dot"
.Documents.Open (mFilePath & mFileName)
.ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
.Application.DisplayAutoCompleteTips = False
.Templates(mFilePath & "Inventerra.dot"
.AutoTextEntries.Item("Inventerra"
.Insert where _
:=Selection.Range, RichText:=True
.ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
.Templates(mFilePath & "Inventerra.dot"
.AutoTextEntries("omlijning"
.Insert where _
:=Selection.Range, RichText:=True
End With
After this i close the activedocument (.doc) and the .dot file and then i close the Word application:
oWord.Quit
then i set the oWord object to nothing, but still it keeps giving me trouble saying it cant find the requested server... it does this at both of the .Templates methods...
MSWinword doesnt appear to stay open in the taskmanager, nor do any of the temp files in the folder appear to be present, i'm sorta lost here..
does any one know this problem and even better.. does anyone know an answer?
many thanks in advance..
It is being used to select an autotext in a .dot file and then using it in a .doc file..
The first time running the code is works perfectly, but the second time it generates an error:
can't find requested server..
this is the bit of code:
Set oWord = New Word.Application
With oWord
.Documents.Open (mFilePath & "Inventerra.dot"

.Documents.Open (mFilePath & mFileName)
.ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
.Application.DisplayAutoCompleteTips = False
.Templates(mFilePath & "Inventerra.dot"


:=Selection.Range, RichText:=True
.ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
.Templates(mFilePath & "Inventerra.dot"


:=Selection.Range, RichText:=True
End With
After this i close the activedocument (.doc) and the .dot file and then i close the Word application:
oWord.Quit
then i set the oWord object to nothing, but still it keeps giving me trouble saying it cant find the requested server... it does this at both of the .Templates methods...
MSWinword doesnt appear to stay open in the taskmanager, nor do any of the temp files in the folder appear to be present, i'm sorta lost here..
does any one know this problem and even better.. does anyone know an answer?

many thanks in advance..