- One "trick" is to record a macro that does what you want to do and then look at the VBA code generated and translate it as above for ActiveX.
List all custom properties and add a new one with actxserver Word
75 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi all,
I am using actxserver for Word-Documents and manipulating their custom document properties.
I know how to get and set these values as long as the properties are allready implemented.
But, how do I get a list of all custom document properties?
How do I add a new one?
0 Commenti
Risposte (1)
dpb
il 12 Lug 2024 alle 14:07
Modificato: dpb
il 12 Lug 2024 alle 22:55
That is a Word Q?, not MATLAB. See the <Word VBA Reference>. Look at the object model section and find the custom properties object. There's bound to be an Add method. Your task will be to convert the VBA syntax into a form ActiveX commands can execute. The problem is that the VBA compiler is not available to MATLAB so many of the high level features such as named parameters and multiple dot references to a method/property from an object handle aren't available, All parameters must be passed by position and all methods/properties have to be referenced only from the direct parent object. That's the minimum of the modifications that may be needed from VBA example code.
But, if there's a way with VBA, then with perserverence, one can manage to get it to work with ActiveX interface. It may not be trivial, but is possible.
ADDENDUM
6 Commenti
dpb
il 17 Lug 2024 alle 11:10
"...I am not able to program a macro using VBA"
You don't write the code, you just go through the steps and Word records them in the macro for you...then you go look at the auto-generated code to see what the VBA looks like to do what it was you wanted...
See <Create Macro>. To open VBA, you will need to add the "Developer" addin to get the ribbon access, but that is just adding the button to the ribbon if it hasn't been already..
Vedere anche
Categorie
Scopri di più su ActiveX in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!