I am trying to create and save a .doc file by using a .dot, but my code is saving the insert of the bookmark into both documents. how do I close the .dot file without saving any changes? please ignore the roughness of this code as I am just learning vb and I am trying to see if I can get the basics to work.
Code:
Private Sub Print_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Print_Button.Click
MsgBox(CboName.Text)
Dim appWord As Word.Application = CreateObject("Word.Application")
Dim docWord As Word.Document
Dim opara1 As Word.Paragraph
docWord = appWord.Documents.Open("q:\computer.adm\basbrian\delegation.dot")
'appWord.Documents.Add()
appWord.Visible = True
opara1 = docWord.Content.Paragraphs.Add(docWord.Bookmarks.Item("gm").Range)
opara1.Range.Text = "Stephen Sawtell"
oPara1.Format.SpaceAfter = 6
oPara1.Range.InsertParagraphAfter()
docWord.SaveAs("q:\computer.adm\basbrian\sdb.doc", True)
docWord.Close()
docWord = Nothing
appWord.Application.Quit()
appWord = Nothing
End Sub
End Class