View Full Version : Solved: How to execute a button appearing on a VSTO add-in
hkeiner
12-13-2012, 01:07 PM
Is there a way to execute a button that appears on a add-in that was created using Visual Studio Tools for Office (VSTO)? I am able to add this button to the Quick Access Toolbar (QAT), but I have not figured out how to execute (call) this button using VBA code. I am using Word 2007.
I understand that VBA can execute VSTO code directly if the VSTO code has been appropriately written so that it can be called with VBA code (i.e. exposed to VBA). Unfortunately I do not have the ability to see the VSTO code or to make any changes to the VSTO code. This add-in was created by a software vendor for an audit workpaper managment software package that they sell and they are not able/willing to help us or to make any changes to the VSTO add-in code.
I currently can only add this button to the QAT where it also works fine when clicked. However, I also want to be able to "click" on this button (either on the add-in or the QAT) using VBA code. Is this possible considering my constraints in viewing/changing the existing VSTO code for the button, and if so how could I do this?
fumei
12-13-2012, 04:00 PM
I may not be understanding this, but you should be able to call it by its procedure name.
hkeiner
12-14-2012, 12:15 PM
I believe that the procedure for the custom button on the custom ribbon (and QAT) is contained within a DLL file and that the VSTO add-in file (shown as a COM add-in within Word Options) does not indicate the name of the procedure that is called when the cusom button is clicked. Below is the code in the VSTO add-in file (AutoAuditWordAddIn.vsto) that adds the custom ribbon to WORD. It does not show the name for the procedure applicable to the custom button. It seems to show only the name of the DLL file (AutoAuditWordAddIn.dll) that contains the code behind the custom button.
I concluded that calling the code for the custom button by name using VBA was not feasable or possible based upon my level of knowledge of VSTO and DLL programming and using it with VBA, so I thought there might be another way to merely "click on the custom button" using VBA code without knowing how to call the actual procedure.
If someone can tell me that "clicking" on a custom button using VBA code without calling the underlying procedure can not be done, it will save me time needlesly trying to figure it out on my own. I think it is not possible but I am hoping there is a trick or work-around that might work.
Thanks
AutoAuditWordAddIn.vsto
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1" xmlns:co.v2="urn:schemas-microsoft-com:clickonce.v2" xmlns="urn:schemas-microsoft-com:asm.v2" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xrml="urn:mpeg:mpeg21:2003:01-REL-R-NS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<assemblyIdentity name="AutoAuditWordAddIn.vsto" version="1.0.0.10" publicKeyToken="ab31981d36d32931" language="neutral" processorArchitecture="msil" xmlns="urn:schemas-microsoft-com:asm.v1" />
<description asmv2:publisher="AutoAuditWordAddIn" asmv2:product="AutoAuditWordAddIn" xmlns="urn:schemas-microsoft-com:asm.v1" />
<deployment install="false" />
<dependency>
<dependentAssembly dependencyType="install" codebase="AutoAuditWordAddIn.dll.manifest" size="19799">
<assemblyIdentity name="AutoAuditWordAddIn.dll" version="1.0.0.10" publicKeyToken="ab31981d36d32931" language="neutral" processorArchitecture="msil" type="win32" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<dsig:DigestValue>B6wR7LVe5uhCTvX43uh953iv5aQ=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
<publisherIdentity name="CN=TLR\u0115070" issuerKeyHash="897dad03a972e68ba9def09cdff09bb90aeb159b" /><Signature Id="StrongNameSignature" xmlns="http://schemas.microsoft.com/windows/rel/2005/reldata"><r:license xmlns:r="urn:mpeg:mpeg21:2003:01-REL-R-NS" xmlns:as="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /><Reference URI=""><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /><Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><DigestValue>j4ZtK2qjvAtBs4xlgmOzJoJBhJ4=</DigestValue></Reference></SignedInfo><SignatureValue>Nh9Lhhwzh7ArZGxnAVd30w6PVwqtGZ6ejqCOn1O+mVAUxRn8fM2NGwDo6D1CuEOyKKrUfiRDuj2 Ms7Ig71hqkKfLphwM7HuhMwkTqXNvCM3nriKQgp8h+uAQ5f0S2pmTk4Uevo/5djMypglG+jBaSm5QPzBdsy5Hnh9kpIY790c=</SignatureValue><KeyInfo><KeyValue><RSAKeyValue><Modulus>0CNBMyBSbYhUAOAks1ixllhnzMixauHy+O5hT0QWEi88OHND4V4QD5w0ll+CCFqO6HzbJPSShG/7Ak4H2N1kT0pP9fjKmgDDFZQHgOfNkuu4AwjyGArTX5ae/4Hr/bsjPR9DMucV/QkUo1SNHD3KXA/iVbblEUPjXJWPT4X9Dg0=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue></KeyValue><X509Data><X509Certificate>MIIByTCCATKgAwIBAgIQNI25da68l6tCBwhhZByxbzANBgkqhkiG9w0BAQUFADAjMSEwHwYDVQQ DHhgAVABMAFIAXAB1ADAAMQAxADUAMAA3ADAwHhcNMTIwNjA2MTk0NTM0WhcNMTMwNjA3MDE0NT M0WjAjMSEwHwYDVQQDHhgAVABMAFIAXAB1ADAAMQAxADUAMAA3ADAwgZ8wDQYJKoZIhvcNAQEBB QADgY0AMIGJAoGBANAjQTMgUm2IVADgJLNYsZZYZ8zIsWrh8vjuYU9EFhIvPDhzQ+FeEA+cNJZf gghajuh82yT0koRv+wJOB9jdZE9KT/X4ypoAwxWUB4DnzZLruAMI8hgK01+Wnv+B6/27Iz0fQzLnFf0JFKNUjRw9ylwP4lW25RFD41yVj0+F/Q4NAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAHPDJpq0SZi5JjAcZrkn9E+d/QPuljJFtPeZdm32TY+YSSGwcKV4WBNkfHqWhMZuOt0piRKeTDtaI35J450tXLQAW79A2IrTFTee 4K5n1KWyqiBLSnWBqLt0MWImJ6EBUoknqQZE/bje3qdwY3dPKYdCyvZCax/4pda6aslAnuI4=</X509Certificate></X509Data></KeyInfo></Signature></r:issuer></r:license></msrel:RelData></KeyInfo></Signature></asmv1:assembly>
AutoAuditWordAddIn.dll.manifest
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:co.v2="urn:schemas-microsoft-com:clickonce.v2" xmlns="urn:schemas-microsoft-com:asm.v2" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1">
<asmv1:assemblyIdentity name="AutoAuditWordAddIn.dll" version="1.0.0.10" publicKeyToken="ab31981d36d32931" language="neutral" processorArchitecture="msil" type="win32" />
<description xmlns="urn:schemas-microsoft-com:asm.v1">AutoAuditWordAddIn</description>
<application />
<entryPoint>
<co.v1:customHostSpecified />
</entryPoint>
<trustInfo>
<security>
<applicationRequestMinimum>
<PermissionSet Unrestricted="true" ID="Custom" SameSite="site" />
<defaultAssemblyRequest permissionSetReference="Custom" />
</applicationRequestMinimum>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!--
UAC Manifest Options
If you want to change the Windows User Account Control level replace the
requestedExecutionLevel node with one of the following.
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
If you want to utilize File and Registry Virtualization for backward
compatibility then delete the requestedExecutionLevel node.
-->
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
<dependency>
<dependentOS>
<osVersionInfo>
<os majorVersion="5" minorVersion="1" buildNumber="2600" servicePackMajor="0" />
</osVersionInfo>
</dependentOS>
</dependency>
<dependency>
<dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
<assemblyIdentity name="Microsoft.Windows.CommonLanguageRuntime" version="2.0.50727.0" />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
<assemblyIdentity name="Microsoft.Office.Interop.SmartTag" version="12.0.0.0" publicKeyToken="71E9BCE111E9429C" language="neutral" />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
<assemblyIdentity name="Microsoft.Office.Tools.Common.v9.0" version="9.0.0.0" publicKeyToken="B03F5F7F11D50A3A" language="neutral" processorArchitecture="msil" />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
<assemblyIdentity name="Microsoft.Office.Tools.v9.0" version="9.0.0.0" publicKeyToken="B03F5F7F11D50A3A" language="neutral" processorArchitecture="msil" />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
<assemblyIdentity name="Microsoft.Office.Tools.Word.v9.0" version="9.0.0.0" publicKeyToken="B03F5F7F11D50A3A" language="neutral" processorArchitecture="msil" />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
<assemblyIdentity name="Microsoft.VisualStudio.Tools.Applications.Hosting.v9.0" version="9.0.0.0" publicKeyToken="B03F5F7F11D50A3A" language="neutral" processorArchitecture="msil" />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
<assemblyIdentity name="Microsoft.VisualStudio.Tools.Applications.Runtime.v9.0" version="9.0.0.0" publicKeyToken="B03F5F7F11D50A3A" language="neutral" processorArchitecture="msil" />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
<assemblyIdentity name="Microsoft.VisualStudio.Tools.Applications.ServerDocument.v9.0" version="9.0.0.0" publicKeyToken="B03F5F7F11D50A3A" language="neutral" processorArchitecture="msil" />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
<assemblyIdentity name="stdole" version="7.0.3300.0" publicKeyToken="B03F5F7F11D50A3A" language="neutral" />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
<assemblyIdentity name="System.Core" version="3.5.0.0" publicKeyToken="b77a5c561934e089" language="neutral" processorArchitecture="msil" />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
<assemblyIdentity name="WindowsBase" version="3.0.0.0" publicKeyToken="31bf3856ad364e35" language="neutral" processorArchitecture="msil" />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="AutoAuditWordAddIn.dll" size="90624">
<assemblyIdentity name="AutoAuditWordAddIn" version="1.0.0.0" language="neutral" processorArchitecture="msil" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<dsig:DigestValue>u/CJDxXMfeIz1KDT5Yg0HJ7AJ9g=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="AxInterop.MSMAPI.dll" size="15872">
<assemblyIdentity name="AxInterop.MSMAPI" version="1.1.0.0" language="neutral" processorArchitecture="msil" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<dsig:DigestValue>NtOgkFcP+mIFSh1o1SnXVKNFiF8=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="Interop.Scripting.dll" size="32768">
<assemblyIdentity name="Interop.Scripting" version="1.0.0.0" language="neutral" processorArchitecture="x86" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<dsig:DigestValue>5IagQ40hn55cjsKOC0wsFHQJ8ks=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="Microsoft.Office.Interop.Word.dll" size="907120">
<assemblyIdentity name="Microsoft.Office.Interop.Word" version="14.0.0.0" publicKeyToken="71E9BCE111E9429C" language="neutral" processorArchitecture="msil" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<dsig:DigestValue>mRSB1k8bC7UAwoGX+xBD2vqT7GQ=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="Microsoft.Vbe.Interop.dll" size="63336">
<assemblyIdentity name="Microsoft.Vbe.Interop" version="14.0.0.0" publicKeyToken="71E9BCE111E9429C" language="neutral" processorArchitecture="msil" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<dsig:DigestValue>H4lHETldL8Rv/mYBu/HRDyZwUxU=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="Office.dll" size="448360">
<assemblyIdentity name="office" version="14.0.0.0" publicKeyToken="71E9BCE111E9429C" language="neutral" processorArchitecture="msil" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<dsig:DigestValue>I5WeW6esLo/jOaGQySB65kkcy+k=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="Paisley.AAwin.BLL.dll" size="206336">
<assemblyIdentity name="Paisley.AAwin.BLL" version="1.0.0.0" language="neutral" processorArchitecture="msil" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<dsig:DigestValue>z28SBG4WbPtXBMx9gkmv0uwWX90=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="Paisley.AAWin.BO.dll" size="112640">
<assemblyIdentity name="Paisley.AAWin.BO" version="1.0.0.0" language="neutral" processorArchitecture="msil" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<dsig:DigestValue>WDrBrTduqyfbcncFjh4gXd1n9fY=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="Paisley.AAWin.Data.dll" size="117248">
<assemblyIdentity name="Paisley.AAWin.Data" version="1.0.0.0" language="neutral" processorArchitecture="msil" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<dsig:DigestValue>h5lH0J/5ZJX71jjyK9Om4ZLH3Kg=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="Paisley.AAWin.UIO.dll" size="46592">
<assemblyIdentity name="Paisley.AAWin.UIO" version="1.0.0.0" language="neutral" processorArchitecture="msil" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<dsig:DigestValue>1ofdG/1VkrYI47MU4y9OJ9TnpVM=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="Paisley.AAWin.Util.dll" size="87552">
<assemblyIdentity name="Paisley.AAWin.Util" version="1.0.0.0" language="neutral" processorArchitecture="msil" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<dsig:DigestValue>+G2Et1dsEEUxgb1MJnWKDUXmG6Y=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="Xceed.Compression.dll" size="94832">
<assemblyIdentity name="Xceed.Compression" version="2.0.105.0" publicKeyToken="BA83FF368B7563C6" language="neutral" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<dsig:DigestValue>s5WoiIag/fSxWYr1Ng0xnG4uM6c=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="Xceed.Compression.Formats.dll" size="57984">
<assemblyIdentity name="Xceed.Compression.Formats" version="1.0.105.0" publicKeyToken="BA83FF368B7563C6" language="neutral" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<dsig:DigestValue>QDZV5Z/2lNPgH6+3bgx/qEyE3Tg=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="Xceed.FileSystem.dll" size="107120">
<assemblyIdentity name="Xceed.FileSystem" version="2.0.105.0" publicKeyToken="BA83FF368B7563C6" language="neutral" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<dsig:DigestValue>7z5flh6bgnlpgxd5o8khOzvi7v0=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="Xceed.Zip.dll" size="176736">
<assemblyIdentity name="Xceed.Zip" version="2.0.105.0" publicKeyToken="BA83FF368B7563C6" language="neutral" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<dsig:DigestValue>izk7uhM5o/CPqNy9EFZzeC5hDaA=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
<vstav3:addIn xmlns:vstav3="urn:schemas-microsoft-com:vsta.v3">
<vstav3:entryPointsCollection>
<vstav3:entryPoints>
<vstav3:entryPoint class="AutoAuditWordAddIn.ThisAddIn">
<assemblyIdentity name="AutoAuditWordAddIn" version="1.0.0.0" language="neutral" processorArchitecture="msil" />
</vstav3:entryPoint>
</vstav3:entryPoints>
</vstav3:entryPointsCollection>
<vstav3:update enabled="true">
<vstav3:expiration maximumAge="7" unit="days" />
</vstav3:update>
<vstav3:application>
<vstov4:customizations xmlns:vstov4="urn:schemas-microsoft-com:vsto.v4">
<vstov4:customization>
<vstov4:appAddIn application="Word" loadBehavior="3" keyName="AutoAuditWordAddIn">
<vstov4:friendlyName>AutoAuditWordAddIn</vstov4:friendlyName>
<vstov4:description>AutoAuditWordAddIn</vstov4:description>
</vstov4:appAddIn>
</vstov4:customization>
</vstov4:customizations>
</vstav3:application>
</vstav3:addIn>
<publisherIdentity name="CN=TLR\u0115070" issuerKeyHash="897dad03a972e68ba9def09cdff09bb90aeb159b" /><Signature Id="StrongNameSignature" xmlns="http://schemas.microsoft.com/windows/rel/2005/reldata"><r:license xmlns:r="urn:mpeg:mpeg21:2003:01-REL-R-NS" xmlns:as="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /><Reference URI=""><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /><Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><DigestValue>nh1jQX+x4Y1pDHgY37KKp8C0UWo=</DigestValue></Reference></SignedInfo><SignatureValue>ZN3TqcucYSzMghrhJ6iuXIMiDHBXNwDSP24wN8V46Dyh5ZtsyfPm59HRXoz6huTLscueJTN3SXu IRQRgaYX6QrPyGua1dKpBES1lgJ+Jgt66iuc5lUW5aB893EWYWjzRuqoi2lx+JK6QNiYeMmq2z/9/O/y8F+TDXNTu7Axdu+k=</SignatureValue><KeyInfo><KeyValue><RSAKeyValue><Modulus>0CNBMyBSbYhUAOAks1ixllhnzMixauHy+O5hT0QWEi88OHND4V4QD5w0ll+CCFqO6HzbJPSShG/7Ak4H2N1kT0pP9fjKmgDDFZQHgOfNkuu4AwjyGArTX5ae/4Hr/bsjPR9DMucV/QkUo1SNHD3KXA/iVbblEUPjXJWPT4X9Dg0=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue></KeyValue><X509Data><X509Certificate>MIIByTCCATKgAwIBAgIQNI25da68l6tCBwhhZByxbzANBgkqhkiG9w0BAQUFADAjMSEwHwYDVQQ DHhgAVABMAFIAXAB1ADAAMQAxADUAMAA3ADAwHhcNMTIwNjA2MTk0NTM0WhcNMTMwNjA3MDE0NT M0WjAjMSEwHwYDVQQDHhgAVABMAFIAXAB1ADAAMQAxADUAMAA3ADAwgZ8wDQYJKoZIhvcNAQEBB QADgY0AMIGJAoGBANAjQTMgUm2IVADgJLNYsZZYZ8zIsWrh8vjuYU9EFhIvPDhzQ+FeEA+cNJZf gghajuh82yT0koRv+wJOB9jdZE9KT/X4ypoAwxWUB4DnzZLruAMI8hgK01+Wnv+B6/27Iz0fQzLnFf0JFKNUjRw9ylwP4lW25RFD41yVj0+F/Q4NAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAHPDJpq0SZi5JjAcZrkn9E+d/QPuljJFtPeZdm32TY+YSSGwcKV4WBNkfHqWhMZuOt0piRKeTDtaI35J450tXLQAW79A2IrTFTee 4K5n1KWyqiBLSnWBqLt0MWImJ6EBUoknqQZE/bje3qdwY3dPKYdCyvZCax/4pda6aslAnuI4=</X509Certificate></X509Data></KeyInfo></Signature></r:issuer></r:license></msrel:RelData></KeyInfo></Signature></asmv1:assembly>
fumei
12-14-2012, 01:46 PM
Try going to the MSDN Word Developer forum
http://social.msdn.microsoft.com/Forums/en-US/category/officedev
Cindy Meister in particular is familiar with VSTO.
You may be correct, but it may be worthwhile to post there.
hkeiner
12-14-2012, 02:40 PM
I thought there might be another way to merely "click on the custom button" using VBA code without knowing how to call the actual procedure. I think it is not possible ...
Try going to the MSDN Word Developer forum
http://social.msdn.microsoft.com/Forums/en-US/category/officedev
Cindy Meister in particular is familiar with VSTO.
You may be correct, but it may be worthwhile to post there.
I'll give the other forum a try but I expect that that there is no way to simulate a "click" on a custom button on a custom ribbon using only VBA code without any knowlege or "call" of the associated procedures contained within the VSTO or DLL files. I have such high respect for your VBA knowledge (based upon your many posts on this forum) that I am sure that if this was possible you would be the one to know how to do it. Thanks for your reponses.
fumei
12-14-2012, 06:31 PM
Well thanks for that but you are correct, there is no way to call a procedure in VBA without its name. I have no idea if Cindy, or someone else, may be able to help, but it is worth asking at least. I am not familiar enough with VSTO, but DLL acts the same as "straight" VBA. Procedures are called by name.
hkeiner
12-20-2012, 12:14 PM
Fumei,
Thanks for directing me to the MSND forum for a solution. Cindy and some other folks there were able to help me ascertain what solutions would work for me and which would not. Turns out that code associated with the Replace Tokens button on the custom ribbon resided in a DLL file and that code in the DLL file was not exposed to VBA, so no solution there. However, Cindy suggested a very simple solution using SendKeys to mimic using the keyboard to invoke the Replace Tokens button. Turns out that pressing the ALT key on the keyboard displays the keyboard equivelents of ribbons and ribbon buttons and then clicking on the appropriate keyboard keys will invoke a desired button. I didn't now this before.
Below is a simplified outline of the solution that worked for my situation. This might be of help to others that comes across this thread looking to solve a similar problem.
This is how to invoke the "Replace Tokens" button using only the physical keyboard:
- Press the ALT key and Word shows an interface letter of "Y" for the custom add-in ribbon.
- Press the "Y" key and Word shows an interface letter/number of "Y0" for the Replace Tokens button.
- Press the "Y" key and then the "0" key to invoke the Replace Tokens button.
This is true for all the PCs in our work group that have this custom add-in ribbon installed.
This is how to invoke the "Replace Tokens" button using only VBA code:
Sub SimulateClickOnReplaceTokensButton()
SendKeys "%", True ' ALT key
SendKeys "(Y)", True
SendKeys "(Y)", True
SendKeys "(0)", True
End Sub
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.