Hi everyone!
I'm trying to develop a program in App Designer, where I introduce some data about a subject, such as: Name, ID number, Nationality, etc... And then I introduce these data in some specifc points of a fix text, something quite similar to: The student <<Name>> with ID number <<ID Number>>.
I have achieved to put all this text in a 'word' file, but I'm having some problems when I try to save it. If I achive to save it, then I can't open it because the document has problems, other things that I have tried don't allow me to save it, so I don't know what I have to do.
Nombre = app.NombrealumnoEditField.Value;
expression=' ';
replace='_';
Nombre1=regexprep(Nombre,expression,replace);
Nombre_Fich=strcat('CONTRATO_',Nombre1,'.docx')
word = actxserver('Word.Application');
word.Visible =1;
document=word.Documents.Add;
.
.
.
Name_File=strcat('CONTRATO_',Nombre1,'.docx')
[Name,Path] = uiputfile(Nombre_Fich,'Save file name')
Name_Path = fullfile(Path,Name)
save(Name_Path);
I have also tried (Following a similar question) to use document() and open, but I get the next error:
Error using mlreportgen.dom.Document/open
Unable to check out a Report Generator license. Reason: License checkout failed.
License Manager Error -5
Cannot find a license for MATLAB_Report_Gen.
Troubleshoot this issue by visiting:
https://www.mathworks.com/support/lme/R2019b/5
Diagnostic Information:
Feature: MATLAB_Report_Gen
License path: C:\Users\USUARIO\AppData\Roaming\MathWorks\MATLAB\R2019b_licenses\license_DESKTOP-1JHTRA4_40589230_R2019b.lic;C:\Program Files\MATLAB\R2019b\licenses\license.dat;C:\Program Files\MATLAB\R2019b\licenses
Licensing error: -5,357.
Nombre = app.NombrealumnoEditField.Value;
expression=' ';
replace='_';
Nombre1=regexprep(Nombre,expression,replace);
Nombre_Fich=strcat('CONTRATO_',Nombre1,'.docx')
[Name,Path] = uiputfile(Nombre_Fich,'Save file name');
Name_Path = fullfile(Path,Name);
Contract = Document(Name_Path,'docx');
open(Contrato);
Thank you in advance!