M
MarkC
Can anyone help please, I have the macro below which selects 1 of 2 forms
based on critera in an excel spreadsheet cell. What is not happeneing , is
that a normal word doc should open from the word template its based on. But
the macro below opens the .dot template....not creating a doc from the
template.
can anyone help please!.
Sub GetWordDocument()
Dim oWordApp As Object
Dim oDoc As Object
Dim sFilename As String
Set oWordApp = CreateObject("Word.Application")
If Range("G3").Value = "Y" Then
sFilename = "M:\001_Quality\Manual advice Notes\Template\ST011AFO
Issue 1 Advice note AND Customs invoice.dot"
Else
sFilename = "M:\001_Quality\Manual advice Notes\Template\ST011FO
Issue 4 Manual Advice Note.dot"
End If
Set oDoc = oWordApp.Documents.Open(sFilename)
oWordApp.Visible = True
Set oDoc = Nothing
Set oWordApp = Nothing
End Sub
Private Sub CommandButton1_Click()
End Sub
based on critera in an excel spreadsheet cell. What is not happeneing , is
that a normal word doc should open from the word template its based on. But
the macro below opens the .dot template....not creating a doc from the
template.
can anyone help please!.
Sub GetWordDocument()
Dim oWordApp As Object
Dim oDoc As Object
Dim sFilename As String
Set oWordApp = CreateObject("Word.Application")
If Range("G3").Value = "Y" Then
sFilename = "M:\001_Quality\Manual advice Notes\Template\ST011AFO
Issue 1 Advice note AND Customs invoice.dot"
Else
sFilename = "M:\001_Quality\Manual advice Notes\Template\ST011FO
Issue 4 Manual Advice Note.dot"
End If
Set oDoc = oWordApp.Documents.Open(sFilename)
oWordApp.Visible = True
Set oDoc = Nothing
Set oWordApp = Nothing
End Sub
Private Sub CommandButton1_Click()
End Sub