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. problem exporting result from vb.net to ms word

problem exporting result from vb.net to ms word

Scheduled Pinned Locked Moved Visual Basic
helptutorialcsharpquestion
4 Posts 3 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.
  • U Offline
    U Offline
    uktrips007
    wrote on last edited by
    #1

    Dear friends hi I m facing a problem.I've to export result fetched by vb.net code in ms word.I did it but after quiting word in vb.net it ask me to save changes when document get loaded.if i don't close ms-word instance in vb.net code it leave a winword.exe process after i quit my program.so can u guide me how to avoid this message when document loaded. "do u want to save changes?". I think If i save my document before, closing it problem can be solved but I don't know how to do this. Please help me !!!!!!!!!!! Thanking you !!! Uttam kumar :confused::confused: be the best...

    B K 2 Replies Last reply
    0
    • U uktrips007

      Dear friends hi I m facing a problem.I've to export result fetched by vb.net code in ms word.I did it but after quiting word in vb.net it ask me to save changes when document get loaded.if i don't close ms-word instance in vb.net code it leave a winword.exe process after i quit my program.so can u guide me how to avoid this message when document loaded. "do u want to save changes?". I think If i save my document before, closing it problem can be solved but I don't know how to do this. Please help me !!!!!!!!!!! Thanking you !!! Uttam kumar :confused::confused: be the best...

      B Offline
      B Offline
      Briga
      wrote on last edited by
      #2

      I really don't know how the Word works but with the MapPoint object you have a property called Saved. If you set it to True before closing it won't bother you with any request. I guess/hope there's something similar in the Word Interop. have a look at the doc. Well I did look at the doc and easily found: Quit: Quits Word. You can optionally save any open documents, passing a value from the WdSaveOptions enumeration: wdSaveChanges, wdPromptToSaveChanges, and wdDoNotSaveChanges. The following fragment shows all three different ways to quit Word: (...) -- modified at 7:38 Tuesday 29th November, 2005

      1 Reply Last reply
      0
      • U uktrips007

        Dear friends hi I m facing a problem.I've to export result fetched by vb.net code in ms word.I did it but after quiting word in vb.net it ask me to save changes when document get loaded.if i don't close ms-word instance in vb.net code it leave a winword.exe process after i quit my program.so can u guide me how to avoid this message when document loaded. "do u want to save changes?". I think If i save my document before, closing it problem can be solved but I don't know how to do this. Please help me !!!!!!!!!!! Thanking you !!! Uttam kumar :confused::confused: be the best...

        K Offline
        K Offline
        KaptinKrunch
        wrote on last edited by
        #3

        Why would Word prompt you to save while opening a file. Are you sure about the location that the message is thrown from? My implementation of opening/closing MS Word doc from VB.NET that does not prompt for anything and does not leave a winword process running. Dim app As Microsoft.Office.Interop.Word.Application app = New Microsoft.Office.Interop.Word.Application app.Visible = True Dim doc As Microsoft.Office.Interop.Word.Document doc = app.Documents.Open("C:\Test.doc", Type.Missing, True, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, True, Type.Missing, Type.Missing, Type.Missing, Type.Missing) doc.Close(False, Type.Missing, Type.Missing) app.Quit()

        U 1 Reply Last reply
        0
        • K KaptinKrunch

          Why would Word prompt you to save while opening a file. Are you sure about the location that the message is thrown from? My implementation of opening/closing MS Word doc from VB.NET that does not prompt for anything and does not leave a winword process running. Dim app As Microsoft.Office.Interop.Word.Application app = New Microsoft.Office.Interop.Word.Application app.Visible = True Dim doc As Microsoft.Office.Interop.Word.Document doc = app.Documents.Open("C:\Test.doc", Type.Missing, True, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, True, Type.Missing, Type.Missing, Type.Missing, Type.Missing) doc.Close(False, Type.Missing, Type.Missing) app.Quit()

          U Offline
          U Offline
          uktrips007
          wrote on last edited by
          #4

          hi dear first of all thanks for ur quick answer!.;) Actually I m opening a new document and then pasting my result in tabluar form.so after this if i close this then it as me for changes to be saved or not. if i save this document from vb.net then it shows me save dialog box.I want to avoid that.is there any way by which i can save my document with vb.net only.it must not pop up save dialogbox for the name.:-O be the best...

          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