Upgraded to Office 2010, now Word automation not working from Matlab - The 'Color' property name is ambiguous in the 'Microsoft_Word_14.0_Object_Library._Font' class.
5 次查看(过去 30 天)
显示 更早的评论
After performing a lot of calculations I am generating a word document via automation.
I create the document via:
MATLAB code
wordApp = actxserver('word.Application');
wordDoc = invoke(get(wordApp, 'Documents'), 'Add');
At one point I try and set the text color via:
MATLAB code
selection = wordApp.Selection;
selection.Font.Color = 255;
This worked fine (perfectly!) until I upgraded to Word 2010, now I get the error:
The 'Color' property name is ambiguous in the 'Microsoft_Word_14.0_Object_Library._Font' class.
I have tried a lot of googling and everything I can think of to fix this but no luck.
Does anyone have any ideas please?
Tom.
0 个评论
采纳的回答
tombola
2012-3-20
4 个评论
Igor
2016-12-25
Thanks! This worked perfectly for me. Replaced "actx_word_p.Selection.Font.Color ='wdColorAutomatic'" with "selection.Font.TextColor.RGB ='wdColorAutomatic'". Also replaced "SaveAs" with "SaveAs2".
Jeevraj Hejmady
2019-5-16
Hi,
I'm having similar issue, I tried the above solution but i'm getting an error
![Capture.JPG](https://www.mathworks.com/matlabcentral/answers/uploaded_files/219825/Capture.jpeg)
a = ActXWord.Selection
I'm using matlab 2018b and MS office 365 ProPlus
Any ideas on this error ?
Jeeva
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Environment and Settings 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!