DDE : DocSetViewMode

Only the bookmark, the thumbnail image, and the document change the view mode to the display.
It doesn’t operate in Acrobat Reader.

Syntax

[DocSetViewMode(char* fullPath, char* viewType)]

Argument

fullPath
[char*]
The full path of the PDF file. It is necessary already to be opened by the Acrobat application.
viewType
[char*]
The following character strings are specified with the view mode.
    PDUseThumbs – ‘Page’ Display
    PDUseNone – ‘Only document’ Display
    PDUseBookmarks – ‘It does and descend’ The display.

Returns

true The view mode is set successfully
false Otherwise.

Notes: The return value cannot be acquired with DDE of VBA of Excel.

Sample: VBA of Excel

The view mode of Acrobat PDF is changed to ‘Bookmark’, ‘Thumbnail image’, and ‘Only the document is displayed’ one by one and it displays it.

  • Please confirm the test by the step execution with F8 key.

Sub DDE_DocSetViewMode()
    Dim lChanNo As Long  ‘DDE channel number
    ‘A double quotation mark is added for blank starting full path.
    Const CON_PDF_PATH = “””E:\Test01.pdf”””
   
    ‘The Acrobat application is Started.
    ‘Shell “C:\Program Files\Adobe\Acrobat 8.0\Acrobat\Acrobat.exe"
    Shell “C:\Program Files\Adobe\Acrobat 9.0\Acrobat\Acrobat.exe”
    ‘Open of DDE channel
    lChanNo = DDEInitiate(“Acroview”, “Control”)
   
    ‘1)Open of PDF file
    DDEExecute lChanNo, “[DocOpen(“ & CON_PDF_PATH & “)]”
    ‘2)Displays pages and thumbnail images.
    DDEExecute lChanNo, “[DocSetViewMode(” & _
        CON_PDF_PATH & “,PDUseThumbs)]”
    ‘3)Displays only pages.
    DDEExecute lChanNo, “[DocSetViewMode(” & _
        CON_PDF_PATH & “,PDUseNone)]”
    ‘4)Displays pages and bookmarks.
    DDEExecute lChanNo, “[DocSetViewMode(” & _
        CON_PDF_PATH & “,PDUseBookmarks)]”

‘The Acrobat applicaton is ended.
    ‘If this is not done, the Acrobat process remains.

    DDEExecute lChanNo, “[AppExit()]” 
    ‘The DDE channel is shut.
    DDETerminate lChanNo
End Sub

Execution result

  • 1) Before it executes it.
    DDE:DocSetViewMode 
  • 2) It is executing it.:Displays pages and thumbnail images.
    DDE:DocSetViewMode
  • 3) It is executing it.:Displays only pages.
    DDE:DocSetViewMode
  • 4) It is executing it.:Displays pages and bookmarks.
    DDE:DocSetViewMode

Remarks

  • It doesn’t operate in Acrobat Reader.

Environment to confirm the operation

  • WindowsXP + SP3 + WindowsUpdate
  • Adobe Acrobat Pro 7.0.8 + Office Pro 2003
  • Adobe Acrobat Pro 8.1.4 + Office Pro 2003
  • Adobe Acrobat Pro 9.1.0 + Office Pro 2003