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 

Word: line in bold

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





PostPosted: Wed Mar 14, 2007 7:51 pm    Post subject: Word: line in bold Reply with quote



Hi all, I've a TStringList component and print the elements of the list in a
word document.
In some cases I want the line to be printed in bold. Here is the code:

const
CR = #13#10;
....
if(ansipos(CR,(TStringList(PrintList.items[I])[J]))>0)then begin
DetR.Font.Bold := wdtoggle;
DetR.Collapse(DetDirect);
end;
DetR.InsertAfter(cr+TStringList(PrintList.items[I])[J]);
if(ansipos(CR,(TStringList(PrintList.items[I])[J]))>0)then begin
DetR.Font.Bold := wdtoggle;
DetR.Collapse(DetDirect);
end;

Using this code I only want the lines with the CR at the beginning to print
in bold. Instead it's the entire paragraph until the end of the document
that prints in bold.
How to print only this line in bold ?

Thanks for helping.

Bob
Back to top
Dex
Guest





PostPosted: Wed Apr 11, 2007 12:45 am    Post subject: Re: Word: line in bold Reply with quote



Bob Bedford wrote: >>>

Hi all, I've a TStringList component and print the elements of the
list in a word document. In some cases I want the line to be printed
in bold. Here is the code:

const
CR = #13#10;
...
if(ansipos(CR,(TStringList(PrintList.items[I])[J]))>0)then begin
DetR.Font.Bold := wdtoggle;
DetR.Collapse(DetDirect);
end;
DetR.InsertAfter(cr+TStringList(PrintList.items[I])[J]);
if(ansipos(CR,(TStringList(PrintList.items[I])[J]))>0)then begin
DetR.Font.Bold := wdtoggle;
DetR.Collapse(DetDirect);
end;

Using this code I only want the lines with the CR at the beginning to
print in bold. Instead it's the entire paragraph until the end of the
document that prints in bold. How to print only this line in bold ?

Thanks for helping.

Bob
<<<

Bob,
This may seem like stating the obvious but, have you tried set the font
back to normal after the text you want to bold?

--
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.