How can I write the word "Hi" in multiple lines of Word document using different font sizes?
Mostrar comentarios más antiguos
I wrote This code to disply the word "Hi" in three lines of a Word document with font sizes 16, 32 ,and 48 but it didn't work as expected.
clc
clear
wordApp = actxserver('Word.Application');
wordApp.Visible = true;
doc = wordApp.Documents.Add;
titleText = 'Hi';
Content=doc.Content;
Contentf=Content.font;
for i=1:2
Contentf.bold=true;
Content.paragraphs.alignment=1;
Content.InsertAfter(titleText);
attach=sprintf('%d',i);
Content.InsertAfter(attach);
Contentf.size=16*i;
Content.InsertAfter(char(13));
end
1 comentario
Walter Roberson
el 10 de Mzo. de 2025
What is happening instead of it working as expected?
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Format Reports en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!