- 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
조회 수: 6 (최근 30일)
이전 댓글 표시
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
답변 (1개)
dpb
2024년 7월 12일
편집: dpb
2024년 7월 12일
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
dpb
2024년 7월 17일
"...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..
참고 항목
카테고리
Help Center 및 File Exchange에서 ActiveX에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!