When I select No in my message box prompt, the document still closes. I want it to stay open when i select no. I'm not sure how to do this. Thanks.
Option Explicit
Sub b()
'declares docX as a document and stores it
Dim docX As Documents
'opens the document file
Application.Documents.Open FileName:="C:\Users\johnr\OneDrive\Documents\CIS 208 VBA\Rimando_Input_Box.docm"
'prompts the user to select either Yes or No
MsgBox Prompt:="Close document?", _
Buttons:=vbYesNo
'If the user selects the Yes button then the document closes without making save changes.
If vbYes Then
Application.ActiveDocument.Close SaveChanges:=wdPromptToSaveChanges
Else
'Keep the document open
End If
End Sub