How to publish code as a Word document on a Mac?

I have Mac Office 2011 and R2012b, yet I haven't been able to publish .m code as a word document.
publish('my_fun.m','doc')
results in the following error:
"Error using mxdom2word (line 9) Publishing to Microsoft Word is only supported on the PC."
Really? This basic operation isn't supported? Is there a work-around?

 채택된 답변

Walter Roberson
Walter Roberson 2012년 11월 29일

0 개 추천

Likely the communications with MS Word is handled via ActiveX, which is not present in OS-X.

댓글 수: 1

Walter is right, publishing to Microsoft Word is performed with Active-X, a technology specific to Windows.
As an alternative, would publishing to HTML or PDF (supported on Macs) be workable for you?

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

Matthew Simoneau
Matthew Simoneau 2012년 11월 29일

0 개 추천

A workaround is to publish to HTML, open the HTML up in Word, and then save as Word.

댓글 수: 3

Ward
Ward 2012년 11월 29일
This does work, thanks!
I was hoping for a more direct way to get into Word, but the ActiveX issue seems to preclude that.
This has other drawbacks. For example, Line breaks appear not to be preserved. Seems like a bug in Word 2011.
Great idea! May not be perfect,but better than trying to convert pdf to word - at least as far as I know!

댓글을 달려면 로그인하십시오.

ZHONGQIAN SHANGGUAN
ZHONGQIAN SHANGGUAN 2020년 6월 15일
When I used the code to publish my file, i just got the following error info:
Publishing to Microsoft Word is only supported on the PC.

질문:

2012년 11월 29일

답변:

2020년 6월 15일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by