Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Visual Fox Pro and Word 1

Status
Not open for further replies.

jlucio01

Programmer
May 14, 2010
2
MX
I work in Visual Fox Pro 9 and need to make a report in Word. I have had some advances, but I can't find a command reference to learn about commands like Collapse() and MoveEnd(). Do you have a site where can I found it?

Thanks in advance
 
Look them up in Help?
Collapse method

Collapses a range or selection to the starting or ending position. After a range or selection is collapsed, the starting and ending points are equal.

expression.Collapse(Direction)

expression Required. An expression that returns a Range or Selection object.

Direction Optional Variant. The direction in which to collapse the range or selection. Can be either of the following WdCollapseDirection constants: wdCollapseEnd or wdCollapseStart. The default value is wdCollapseStart.

Remarks
If you use wdCollapseEnd to collapse a range that refers to an entire paragraph, the range is located after the ending paragraph mark (the beginning of the next paragraph). However, you can move the range back one character by using the MoveEnd method after the range is collapsed, as shown in the following example.

Set myRange = ActiveDocument.Paragraphs(1).Range
myRange.Collapse Direction:=wdCollapseEnd
myRange.MoveEnd Unit:=wdCharacter, Count:=-1
Example
This example collapses the selection to an insertion point at the beginning of the previous selection.

Selection.Collapse Direction:=wdCollapseStart
This example sets myRange equal to the contents of the active document, collapses myRange, and then inserts a 2x2 table at the end of the document.

Set myRange = ActiveDocument.Content
myRange.Collapse Direction:=wdCollapseEnd
ActiveDocument.Tables.Add Range:=myRange, NumRows:=2, NumColumns:=2

Gerry
 
Thanks Fumei:
Really a value answer. I have downloaded a chapter from s Tamar Granor Book very interesting, but I follow looking for a command reference for this subject

Thanks for your information
 
Help is vastly better than it used to be.

Gerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top