简体   繁体   中英

OLEObject available verbs for Adobe Acrobat Documents

I'm embedding a PDF in an Excel file and then using VBA to open it as follows:

Dim objMan As OLEObject
Set objMan = ThisWorkbook.Worksheets("Public").OLEObjects.Item("Doc")
objMan.Activate

The problem I have is that it opens it in the background and the used then needs to manually open it from the taskbar to view it. While looking for some method for an OLEObject to set focus or something, I came across the Verb Method for OLEObjects.

MSDN states that this method sends a command to the OLEObject and the available commands "are determined by the object's source application".

My question is: how do I determine what verbs are available for an Adobe Acrobat Document?

You should not need to use the .Activate method on the OLEObject , unless there is some specific reason that you need it to be Active within the workbook/worksheet. Most of the time, there is no reason to do this.

There are only two Verbs available for an embedded PDF OLEObject :

PDF OleObject动词

When I do oleObj.Verb xlVerbOpen this opens the PDF with focus on my machine (Win 7/Excel 2010).

When I do oleObj.Verb xlVerbPrimary this activates the PDF but does not give it focus.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM