Using activex control for word - no spacing between paragraphs
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
James Boyle
am 19 Jul. 2017
Kommentiert: James Boyle
am 25 Jul. 2017
Word seems to default to paragraphs taking up two spaces. I wan it to make a MATLAB code that will generate a report, but when I use the command selection.TypeParagraph it does a double space, as is the default. I cannot seem to find a way of changing this so that there is no spacing. I'm new to activex. The basic idea of the code is below. Any help much appreciated! (Using 2016a, windows) I want it to output
Text here:
Second line of text:
But currently it is outputting as...
Text here:
.
Second line of text:
word = actxserver('Word.Application'); word.Visible = 1; document = word.Documents.Add; selection=word.Selection;
selection.TypeText('Text here:'); selection.TypeParagraph selection.TypeText('Second line of text:');
0 Kommentare
Akzeptierte Antwort
Sangeetha Jayaprakash
am 25 Jul. 2017
Try changing the spacing between paragraphs by changing the "LineUnitAfter" property as follows:
selection.Paragraphs.LineUnitAfter = 0.01
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu ActiveX finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!