I use the code below to take a preformatted word doc, open it, save some information to text boxes and then save a copy of it in a different folder.
And this works great except for the Microsoft Word box that asks:
Do you want to save changes you made to xxxxxxxxxxx.doc?
I think I attached an example of it.
Is there anyway to stop this box from coming up?
Its not happening in the original, that one closes with no issues. Its the .doc I save to the new folder that is bringing up the box.
Code:
Dim appWord As Word.Application
Dim doc As Word.Document
On Error Resume Next
Err.Clear
'Set appWord object variable to running instance of Word.
Set appWord = GetObject(, "Word.Application")
If Err.Number <> 0 Then
'If Word isn't open, create a new instance of Word.
Set appWord = New Word.Application
End If
Set doc = appWord.Documents.Open("" & MSONewIssue & "", , True)
With doc
.FormFields("Text1").Result = Me.Text121.Value
.FormFields("Text2").Result = Me.Text124.Value
.FormFields("Text3").Result = Me.Text126.Value
.FormFields("Text4").Result = Me.Text130.Value
.FormFields("Text5").Result = Date
.Visible = True
.Activate
.SaveAs "" & Issue & ""
.Close
End With
Set doc = Nothing
appWord.ActiveDocument.Close
appWord.Quit
Set appWord = Nothing
And this works great except for the Microsoft Word box that asks:
Do you want to save changes you made to xxxxxxxxxxx.doc?
I think I attached an example of it.
Is there anyway to stop this box from coming up?
Its not happening in the original, that one closes with no issues. Its the .doc I save to the new folder that is bringing up the box.