|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.esri.arcgis.interop.Dispatch com.esri.arcgis.framework.IVbaApplicationProxy
public class IVbaApplicationProxy
Provides access to members that modify the VBA projects in this application.
The Application object implements the IVbaApplication interface.
The IVbaApplication interface allows you to programmatically insert, remove, and run VBA code without actually opening the Visual Basic Editor. This interface has methods to create a new module, insert code into a specific module, remove a module, and run and macro.
Field Summary | |
---|---|
boolean |
noncastable
|
Fields inherited from class com.esri.arcgis.interop.Dispatch |
---|
DISPATCH_METHOD, DISPATCH_PROPERTYGET, DISPATCH_PROPERTYPUT, DISPATCH_PROPERTYPUTREF, objRef |
Constructor Summary | |
---|---|
|
IVbaApplicationProxy()
|
|
IVbaApplicationProxy(Object obj)
|
protected |
IVbaApplicationProxy(Object obj,
String iid)
|
Method Summary | |
---|---|
void |
addListener(String iidStr,
Object theListener,
Object theSource)
|
void |
createCodeModule(String docName,
String moduleName)
Creates a code module in the specified VBA project. |
void |
insertCode(String docName,
String moduleName,
String codeText)
Inserts code into the specified module. |
void |
removeCodeModule(String docName,
String moduleName)
Removes a code module from the specified VBA project. |
void |
removeListener(String iidStr,
Object theListener)
|
Object |
runVBAMacro(String docName,
String moduleName,
String macroName,
Object arguments)
Runs the specified VBA macro. |
Methods inherited from class com.esri.arcgis.interop.Dispatch |
---|
bindUsingMoniker, constructVtblPosTable, convertToNative, cookieForListener, createDispatch, createObjrefMonikerDisplayName, equals, getActiveObject, getActiveObject, getDefaultProperty, getDispatchIdOfName, getLastErrorCode, getMtsObjectContext, getObjRef, getPropertyByName, getPropertyByName, getVtblPos, hashCode, initDispatch, invoke, invokeMethodByName, invokeMethodByName, invokeMethodByName, invokePropertyGetByName, invokePropertyPutByName, invokePropertyPutByRefByName, isNativeMode, isObjRef, optimizedVtblInvoke, queryInterface, readExternal, release, setNativeMode, setPropertyByName, toString, vtblInvoke, writeExternal |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public boolean noncastable
Constructor Detail |
---|
public IVbaApplicationProxy()
public IVbaApplicationProxy(Object obj) throws IOException
IOException
protected IVbaApplicationProxy(Object obj, String iid) throws IOException
IOException
Method Detail |
---|
public void addListener(String iidStr, Object theListener, Object theSource) throws IOException
addListener
in class com.esri.arcgis.interop.Dispatch
IOException
public void removeListener(String iidStr, Object theListener) throws IOException
removeListener
in class com.esri.arcgis.interop.Dispatch
IOException
public Object runVBAMacro(String docName, String moduleName, String macroName, Object arguments) throws IOException, AutomationException
docName specifes the name of the VBA project that contains the macro you want to run.
moduleName specifes the name of the module that contains the macro you want to run.
MacroName specifies the name of the macro you want to run.
arguments is a Variant array that represents the arguments that you want to pass into this macro.
If the macro is in the current document, docName will be "Project".
If the macro is in the Normal template, docName will be "Normal".
If the macro is in a template, docName will be "TemplateProject".
If you want to pass arguments into this macro you are running, first add the arguments to an array and then use that array for arguments parameter of the RunVBAMacro method.
runVBAMacro
in interface IVbaApplication
docName
- The docName (in)moduleName
- The moduleName (in)macroName
- The macroName (in)arguments
- A Variant (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void createCodeModule(String docName, String moduleName) throws IOException, AutomationException
docName specifes the name of the VBA project in which you want to create the module.
moduleName specifes the name of the module that you want to create.
If you want to create the module in the current document, docName will be "Project".
If you want to create the module in the Normal template, docName will be "Normal".
If you want to create the module in a template, docName will be "TemplateProject".
createCodeModule
in interface IVbaApplication
docName
- The docName (in)moduleName
- The moduleName (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void removeCodeModule(String docName, String moduleName) throws IOException, AutomationException
docName specifes the name of the VBA project from which you want to remove the module.
moduleName specifes the name of the module that you want to remove.
If you want to remove a module from the current document, docName will be "Project".
If you want to remove a module from the Normal template, docName will be "Normal".
If you want to remove a module from a template, docName will be "TemplateProject".
removeCodeModule
in interface IVbaApplication
docName
- The docName (in)moduleName
- The moduleName (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void insertCode(String docName, String moduleName, String codeText) throws IOException, AutomationException
docName specifes the name of the VBA project that contains the module in which you want to insert code.
moduleName specifes the name of the module in which you want to insert code. This module must already exist in the VBA project.
codeText is a string that represents all the code for the macro.
If you want to insert code into a module in the current document, docName will be "Project".
If you want to insert code into a module in the Normal template, docName will be "Normal".
If you want to insert code into a module in a template, docName will be "TemplateProject".
The string for codeText must include all the text for the macro code including the sub procedure declaration and end sub.
insertCode
in interface IVbaApplication
docName
- The docName (in)moduleName
- The moduleName (in)codeText
- The codeText (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |