• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How can close document not save?

Enthusiast ,
Apr 25, 2019 Apr 25, 2019

Copy link to clipboard

Copied

I delete page when process data, i want close document not save.

This my code:

       Dim oArobat As Object

                oArobat = CreateObject("AcroExch.App")

                oArobat.Show()

                Dim oDoc As Object

                oDoc = CreateObject("AcroExch.PDDoc")

                Dim oAVDoc As Object

                oAVDoc = CreateObject("AcroExch.AVDoc")

                If oAVDoc.Open(strWorkFilePath, "") = True Then                   

                    oDoc = oAVDoc.GetPDDoc

                End If

                 oDoc.DeletePages(0, iPage - 2)

              

                // todo data

                 //Close

               oDoc.Close()  // can't close

               oArobat.CloseAllDocs()  // show dialog confirm save

How can close document not save?

TOPICS
Acrobat SDK and JavaScript

Views

1.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Apr 25, 2019 Apr 25, 2019

You are trying to close the PDDoc, which does not give you control over the prompt. If you use the AVDoc to close your document, the Close function has a parameter that indicates if the file should be saved or not:

Acrobat DC SDK Documentation - AVDoc.Close

Alternatively, you can set the dirty flag:

Acrobat DC SDK Documentation - PDDoc.SetFlags

I have never done this using IAC, but I would guess that you need to reset the PDDocNeedsSave flag.

Votes

Translate

Translate
Community Expert ,
Apr 25, 2019 Apr 25, 2019

Copy link to clipboard

Copied

LATEST

You are trying to close the PDDoc, which does not give you control over the prompt. If you use the AVDoc to close your document, the Close function has a parameter that indicates if the file should be saved or not:

Acrobat DC SDK Documentation - AVDoc.Close

Alternatively, you can set the dirty flag:

Acrobat DC SDK Documentation - PDDoc.SetFlags

I have never done this using IAC, but I would guess that you need to reset the PDDocNeedsSave flag.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines