locked
Application Object... need some help RRS feed

Answers

  • I can't find the documentation for it, but the first argument for the Close method on Document objects seems to be a notion of "save changes". So doing this:

    doc.Close(True)

    will save the document and close it.


    Justin Anderson, LightSwitch Development Team

    • Proposed as answer by Spursoft Solutions Wednesday, February 15, 2012 2:36 PM
    • Marked as answer by tsiakk Wednesday, February 15, 2012 3:59 PM
    Wednesday, February 15, 2012 12:46 PM
    Moderator

All replies

  • The first link (options link) describes how to close documents and Word itself under the Closing Documents section.

    Justin Anderson, LightSwitch Development Team

    Wednesday, February 15, 2012 8:01 AM
    Moderator
  • Hi..I am trying the following commands but i am getting the error { Error while invoking WdSaveOptions - member not found. } .Can you please help fix it ? If i try doc.Close() it works okay, but if i want to : Close all documentsa and save with no prompt it does not.

        Dim word_application_obj As Object = Nothing
                    word_application_obj = OfficeIntegration.Word.GetWord() 'returns Word.Application Object

    ....

                        Dim doc As Object
                        doc = OfficeIntegration.Word.GenerateDocument(WordFile, PRESCRIPTIONS.SelectedItem, mappingsprescription) 'returns Word.Document object

    ....

       doc.Close(word_application_obj.WdSaveOptions.wdSaveChanges) 'Error while invoking WdSaveOptions - member not found.
    


    Wednesday, February 15, 2012 10:41 AM
  • I can't find the documentation for it, but the first argument for the Close method on Document objects seems to be a notion of "save changes". So doing this:

    doc.Close(True)

    will save the document and close it.


    Justin Anderson, LightSwitch Development Team

    • Proposed as answer by Spursoft Solutions Wednesday, February 15, 2012 2:36 PM
    • Marked as answer by tsiakk Wednesday, February 15, 2012 3:59 PM
    Wednesday, February 15, 2012 12:46 PM
    Moderator
  • thanks !that worked... the only problem is that the Document after the document is closedn an empty instance of MSWORD window stays open and the user has to close it manually.is that normal?

    what do you sugest? thanks

    Wednesday, February 15, 2012 7:22 PM