fprintf to word file with red text
조회 수: 12 (최근 30일)
이전 댓글 표시
I am using fprintf to write to a text file. Since a text file only displays plain text I was looking to see about printing to Microsoft word and putting failed text in red. I know you can do fprintf(2, 'string') and the text will appear red in the command window. But when you write to a specific file such as MyFile, fprintf(2, MyFile, 'string') errors out. Is there a certain format to do this? Thanks.
댓글 수: 2
답변 (2개)
Walter Roberson
2016년 10월 22일
There is no way to output colored text to a plain text file.
Outputting data that Microsoft Word will interpret as indicating something with red text may be practical.
- you could output RTF (Rich Text Format)
- you could use ActiveX to connect to Word and give it the necessary commands to insert text, select part of it, and color the selection.
댓글 수: 0
참고 항목
카테고리
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!