Is it possible to read an MS Word document into Matlab and convert to binary code?

조회 수: 131 (최근 30일)
Good day to you all,
I am currently studying on a level 5 FDSc (go easy, I am low level :)) course and I am looking into methods to achive data secrecy for my dissertation. I have picked quite a large subject to explore here it seems and there are lots of avenues (and pitfalls) to explore!
My initial pathway to progress here is to produce working code, which can take a secret message embedded within a MS Word document and output a binary format code for further encryption using maybe DES16 or something simpler that I will write myself. The end goal is to combine multi layers of encrytion.
My problem is that; so far I am theoretically designing in a way that would use Visual Studio to do the initial conversion and subsiquently means that I would need to use VS for the decryption final stage.
For the ease of operation I would ideally like to keep everything in MATLAB as I have some interesting ideas to progress with later on using MATLAB toolboxes.
So the question then; "Can I import and convert MS Word documents within Matlab?"
Thank-you for your time.
Daz

채택된 답변

Tesfaye Girma
Tesfaye Girma 2021년 2월 28일
%yes offcourse you can
%you can follow this path and read the file you want in matlab
word = actxserver('Word.Application');
wdoc = word.Documents.Open('C:\somewhere\somefile.docx');
%wdoc is the Document object which you can query and navigate.
sometext = wdoc.Content.Text
  댓글 수: 1
darren Clipson
darren Clipson 2021년 3월 1일
Fantastic, thank you for your help!
As the information retrieved from the Word.docx is displayed as plain text, is there also a way to rebuild and open the document in word using MATLAB commands also?
For example, base user (myself right now) would force MATLAB to retrieve the information stored in document and encrypt using 'some' method. Second user would recieve the encrypted document, open within MATLAB and using the decode script (to be compiled); be able to open the original document (all doc.x formatting present).
All of the processes regarding the encryption I will tackle seperately to this question. However, before I proceed I need to prove that MATLAB can handle the beginning, and the end of the function to keep the system simple.
Best Regards.
Daz

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Cell Arrays에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by