Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Word Bold Font for Part of Sentence
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
00966120
Message ID:
00966156
Vues:
7
This message has been marked as a message which has helped to the initial question of the thread.
You could find the starting and ending position of the text and format it as needed. Something like this:
with oWord
	.Selection.EndKey(wdStory)
	lnstart= .Selection.Range.Start

	lcPara1=[Scheduled Case Counts Graph:  Displays information about the scheduling load for the selected date range.  For the selected date range, ]
	.activedocument.content.insertafter(lcPara1)
	.Selection.EndKey(wdStory)
	lnend= .Selection.Range.Start

	lcPara1= [ there have been a total of ]....
	lcPara1=lcPara1+ [ somethiong else]
	.activedocument.content.insertafter(lcPara1+CR)

	WITH .activedocument.Range(lnStart,lnEnd).Font
		.NAME = "Courier New"
		.bold = .T.	
		.color=RGB(255,0,0)
	ENDWITH	

       .......
ENDWITH
>Can anyone tell me how to select and set the font to bold for a portion of a paragraph using word automation? In my case it's the first part of the paragraph. Below is my current code that build the paragraph and adds it to the document.
>
>
>oDocument.InlineShapes.Addpicture(lcFileName1,.t.,.f.,oRange)
>oRange.Insertafter(cr)
>oRange.Collapse(wdCollapseEnd )
>oRange.End = oRange.End + 1
>* How to Bold the first part (Schedule Case Counts Graph:)
>lcPara1=[Scheduled Case Counts Graph:  Displays information about the scheduling load for the selected date range.  For the selected date range, ]
>lcPara1=lcPara1+[ there have been a total of ]+betterstr((thisform.frmscheduledcases+thisform.frmcancelledcases),",")+[ cases scheduled with ]
>lcPara1=lcPara1+betterstr(thisform.frmCancelledCases,",")+[ cancelled. This leaves a total of ]+betterstr(thisform.frmscheduledcases)+[ cases currently ]
>lcpara1=lcPara1+[still scheduled.  The following table displays the cancelled cases and reasons for their cancellation.]
>oRange.InsertAfter(lcPara1 + CR)
>
>
>
>I'm reading the Microsoft Office AUtomation with VFP, but I haven't found the answer yet. Thanks in advance.
>
>Kirk
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform