BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Creating a list

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation
View previous topic :: View next topic  
Author Message
bruno82@gmail.com
Guest





PostPosted: Fri Jun 10, 2005 12:31 pm    Post subject: Creating a list Reply with quote



Hi to all! Smile I hope someone can help me very soon, because i have to
finish a job in 1 or 2 hours.

I have a TStringList with some strings and i want to put them in a list
in a word document.
At the moment i'm able to write the strings in separate rows in the
document, with this code (i've cut only relevant rows):

-------------------------------------------
var
Phrases: TStringList;
WordApp : _Application;
Doc : WordDocument;
begin

{ ... Creation of list Phrases ... }

WordApp := CoWordApplication.Create;
Doc:=WordApp.Documents.Add(EmptyParam,EmptyParam,EmptyParam,EmptyParam);

for x:=0 to Phrases.Count-1 do begin
WordApp.Selection.TypeText(inttostr(x+1) + '.' + #9 +
Phrases.Strings[x] + #13#10);
end;

WordApp.Quit(SaveChanges, EmptyParam, EmptyParam);

end;
-------------------------------------------

....but instead i heve to to create a list and put them as items of this
list!

How can i do that??

Thank you very much to everyone who will solve my problem! :)

Bruno

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.