Hi,
the solution I found on "How to list all custom document properties?"
hdlWord = actxserver('Word.Application');
hdlWord.Visible = true;
%% File and Location
docPath = 'folder';
docName = 'PropTest.docx';
fullLocation = [docPath '\' docName];
hdlDoc = hdlWord.Documents.Open(fullLocation);
hdlCDP = hdlDoc.CustomDocumentProperties;
%% Listing all CDPs
nCDP = hdlCDP.Count; % number of custom document properties
for i=1:nCDP
hdlProp(i) = hdlCDP.get('Item', i); % fill cdp handle vector with the interfaces
% For verification only
propName = hdlProp(i).get('Name');
disp(propName); % writing all CDP names
propValue = hdlProp(i).get('Value');
disp(propValue); % writing all CDP values
end
I know that this method of changing size of hdlProp(i) is not a good style, but I did not found a way to initialze an interface vector.