Josir
asked on
How to apply a pre-formated Style using Delphi Word Automation
In VBA/Macro, I can do this with the following command:
Selection.Style = ActiveDocument.Styles("Num eroQuestao ")
How can I do the same with Delphi ?
MSWord := CreateOleObject('Word.Appl ication');
MSWord.Visible := true;
try
ProvaDOC := MSWord.Documents.Add( 'prova.dotx' );
ProvaDOC.Paragraphs.Last.R ange.Selec t;
MSWord.Selection.Style := ProvaDoc.Styles('NumeroQue stao');
But I got a runtime error on the last line: "Item is not a property"
Does someone know the correct translation to a Delphi syntax ?
Selection.Style = ActiveDocument.Styles("Num
How can I do the same with Delphi ?
MSWord := CreateOleObject('Word.Appl
MSWord.Visible := true;
try
ProvaDOC := MSWord.Documents.Add( 'prova.dotx' );
ProvaDOC.Paragraphs.Last.R
MSWord.Selection.Style := ProvaDoc.Styles('NumeroQue
But I got a runtime error on the last line: "Item is not a property"
Does someone know the correct translation to a Delphi syntax ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER