How to read Ms word file in matlab?
Show older comments
i want to read Ms word file in matlab..please someone help me out...Thanks..
4 Comments
Geoff Hayes
on 24 Aug 2014
Do you want to read the content of the MS Word file and manipulate it in some way? Maybe write data back to the document? What is the use case for this? I know you have posted a similar question about reading PDFs too...
Jan
on 24 Aug 2014
It depends on what you want to read. It is trivial to import a binary .doc file as long as you do not want do process the contents. Or importing a text from a .docx might be easy also, but what does "reading" mean in case of tables, mutli-column text and picture?
Aniruddha Phatak
on 24 Aug 2014
If the Word file contains only text, you could try using the textread or textscan function. Also check http://www.mathworks.in/help/matlab/import_export/supported-file-formats.html
I don't believe .doc is supported though I read something about Excel spreadsheets in there...
azizullah khan
on 25 Aug 2014
Answers (1)
per isakson
on 24 Aug 2014
Edited: per isakson
on 24 Aug 2014
I assume you have Ms Word installed. If so
- Search the File Exchange for "ActiveX Word" to get ideas
- See especially OfficeDoc - read/write/format MS Office docs (XLS/DOC/PPT) by Yair Altman
Start an ActiveX session with Word
wordX = actxserver('Word.Application');
and make an experiment
Categories
Find more on Use COM Objects in MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!