TOP > AcroExch.AVPageView > *
説明
現在のドキュメントに対応させたAcroExch.PDDocオブジェクトを取得します。
形式
LPDISPATCH GetDoc();
引数
- 無し。
戻り値
- 実際は現在のドキュメントに関するAcroExch.PDDocオブジェクトが返されます。
動作するバージョン
| Acrobat | 動作 | 備考 |
|---|---|---|
| 4 | ― | Acrobat 4.0 ※Windows 98SE + Excel 2000 |
| 5 | - | Acrobat 5.0.5 |
| 6 | - | Acrobat 6.0.3 Pro |
| 7 | - | Acrobat 7.0.9 Pro Acrobat 7.1.4 Pro |
| 8 | OK | Acrobat 8.1.2 Pro |
| 9 | - | Acrobat 9.3.2 Extended |
| 10 | - | Acrobat X (10.1.8) Extended |
| 11 | - | Acrobat XI (11.0.04) Extended |
- OK:動作します。
- NO:動作しない。 戻り値が0を返します。
- -:未確認。
サンプル:ExcelのVBA
現在のドキュメントに対応させたAcroExch.PDDocオブジェクトを取得します。
- 事前に参照設定をします。
- F8キーでステップ実行しながら動作確認します。
001 Sub AcroExch_AVPageView_GetDoc()
002
003 Dim objAcroPDDoc As New Acrobat.AcroPDDoc
004 Dim objAcroAVDoc As New Acrobat.AcroAVDoc
005 Dim objAVPageView As Acrobat.AcroAVPageView
006 Dim lRet As Long '戻り値
007 Dim lGetNumPages As Long
008
009 'PDFドキュメントを開く
010 lRet = objAcroAVDoc.Open("E:\Test01.pdf", "")
011 'AVPageViewオブジェクトを作成
012 Set objAVPageView = objAcroAVDoc.GetAVPageView
013 'PDDocオブジェクトを作成
014 Set objAcroPDDoc = objAVPageView.GetDoc
015 lGetNumPages = objAcroPDDoc.GetNumPages
016 Debug.Print "lGetNumPages=" & lGetNumPages
017
018 '保存しないでPDFドキュメントを閉じる
019 lRet = objAcroAVDoc.Close(1)
020 lRet = objAcroPDDoc.Close
021
022 'オブジェクトを強制解放する。Acrobatも終了する。
023 Set objAVPageView = Nothing
024 Set objAcroAVDoc = Nothing
025 Set objAcroPDDoc = Nothing
026
027 End Sub
補足
- 特に無し。
Adobe Web 解説
OLE Automation / AcroExch.AVPageView / GetDoc (公式サイト・英語)
動作確認環境
- WindowsXP Pro(+ SP3) +
Acrobat 8.1.2 Pro + Office 2003 + MicrosoftUpdate
< 戻る >