Advertisement
robathome

ActiveX_bullshit

Oct 26th, 2016
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. % Clear the workspace
  2. clearvars;
  3. close all force;
  4. clc;
  5.  
  6. % Specify target file
  7. TargetFile = 'Lorem_Ipsum.docx';
  8.  
  9. % Initialize ActiveX server object
  10. Word_Application = actxserver('Word.Application');
  11. Word_Document = Word_Application.documents.Open([pwd,'\',TargetFile]);
  12.  
  13. % ----------------%
  14. % HERE BE DRAGONS %
  15. % ----------------%
  16.  
  17. % Close ActiveX server
  18. Word_Document.Close;
  19. Word_Application.Quit;
  20. delete(Word_Application);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement