Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Closing Word

Closing Word

Scheduled Pinned Locked Moved Visual Basic
c++help
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    goodoljosh1980
    wrote on last edited by
    #1

    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

    R 1 Reply Last reply
    0
    • G goodoljosh1980

      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

      R Offline
      R Offline
      Rizwan Bashir
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups