Imports System.Runtime.InteropServices _ Public Structure OLECMDTEXT Public cmdtextf As UInt32 Public cwActual As UInt32 Public cwBuf As UInt32 Public rgwz As Char End Structure _ Public Structure OLECMD Public cmdID As Long Public cmdf As UInt64 End Structure ' Interop definition for IOleCommandTarget. _ Public Interface IOleCommandTarget ' IMPORTANT: The order of the methods is critical here. We're going to ' perform early binding in most cases, so the order of the methods ' here MUST match the order of their vtable layout (which is determined ' by their layout in IDL). The interop calls key off the vtable ordering, ' not the symbolic names, so if you switched these method declarations ' and attempted to call Exec() on an IOleCommandTarget interface from your ' app, it would translate into a call to QueryStatus() instead. Sub QueryStatus(ByRef pguidCmdGroup As Guid, ByVal cCmds As UInt32, ByVal prgCmds As OLECMD, ByRef pCmdText As OLECMDTEXT) Sub Exec(ByRef pguidCmdGroup As Guid, ByVal nCmdId As Long, ByVal nCmdExecOpt As Long, ByRef pvaIn As Object, ByRef pvaOut As Object) End Interface