M
MarkC
Can anyone help please, i have the macro below in a workbook. What I would
like is it to open a word doc from the dot template, as word does.The problem
is the macro opens the .dot file, not a .doc from the .dot(template).
Can anyone help, thank you
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\ST011AFO Issue 1 Advice note
AND Customs invoice.dot"
Else
sFilename = "M:\001_Quality\Manual advice Notes\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
like is it to open a word doc from the dot template, as word does.The problem
is the macro opens the .dot file, not a .doc from the .dot(template).
Can anyone help, thank you
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\ST011AFO Issue 1 Advice note
AND Customs invoice.dot"
Else
sFilename = "M:\001_Quality\Manual advice Notes\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