Closing Word
-
Hello all, I am a complete NEWBIE to VB programming, I usually do everything through C++. However, I am using Word for part of a program and am adding command buttons. In the function, I am trying to simply save the document and exit Word. Here is the code I have, but it doesn't seem to do anything. Thanks in advance for the help.... Private Sub CommandButton1_Click() ActiveDocument.Save ActiveDocument.Close Application.Quit End Sub
-
Hello all, I am a complete NEWBIE to VB programming, I usually do everything through C++. However, I am using Word for part of a program and am adding command buttons. In the function, I am trying to simply save the document and exit Word. Here is the code I have, but it doesn't seem to do anything. Thanks in advance for the help.... Private Sub CommandButton1_Click() ActiveDocument.Save ActiveDocument.Close Application.Quit End Sub
All the objects you are creating should be closed. if you are missing any single reference to close then this code will not work. Second thing go to Articles in Code Project and search For Word you will found many solutions -- modified at 3:58 Tuesday 25th July, 2006