Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
WORD Paragraphs collection, how to use it for a border?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00764309
Message ID:
00764364
Vues:
24
This message has been marked as a message which has helped to the initial question of the thread.
You'll obviously need to have some control to get to the selection of paragraphs in question, but hopefully this will get you well on your way.
oWord = CREATEOBJECT( "Word.Application" )
WITH oWord
	.Visible = .T.

	.Documents.Add()

	.Selection.TypeText( "test" )
	.Selection.TypeParagraph
	.Selection.TypeText( "Next Paragraph" )
	.Selection.TypeParagraph
	.Selection.TypeText( "Next Paragraph" )
	.Selection.TypeParagraph
	.Selection.TypeText( "Next Paragraph" )
	.Selection.TypeParagraph
	.Selection.TypeText( "Next Paragraph" )
	.Selection.TypeParagraph
	
	*/ Go to the first page
	.Selection.GoTo( 1 )

	*/ 4 = Paragraphs, 2 = number of paragraphs to "move down" 
	.Selection.MoveDown( 4, 2, 0 )  && the ,0 means MOVE, dont higlight selection
	*/ Now, move down but HIGHLIGHT the paragraphs
	.Selection.MoveDown( 4, 2, 1 )	&& the ,1 means HIGHLIGHT the selection

	WITH .Selection.Borders( -1 )  && Border top...
		.LineStyle = oWord.Options.DefaultBorderLineStyle
		.LineWidth = oWord.Options.DefaultBorderLineWidth
		.Color		= oWord.Options.DefaultBorderColor
	ENDWITH
	WITH .Selection.Borders( -2 )  && Border left...
		.LineStyle = oWord.Options.DefaultBorderLineStyle
		.LineWidth = oWord.Options.DefaultBorderLineWidth
		.Color		= oWord.Options.DefaultBorderColor
	ENDWITH
	WITH .Selection.Borders( -3 )  && Border right...
		.LineStyle = oWord.Options.DefaultBorderLineStyle
		.LineWidth = oWord.Options.DefaultBorderLineWidth
		.Color		= oWord.Options.DefaultBorderColor
	ENDWITH
	WITH .Selection.Borders( -4 )  && Border bottom...
		.LineStyle = oWord.Options.DefaultBorderLineStyle
		.LineWidth = oWord.Options.DefaultBorderLineWidth
		.Color		= oWord.Options.DefaultBorderColor
	ENDWITH

ENDWITH
HTH
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform