Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Read word document 1 page at a time
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01023431
Message ID:
01023553
Views:
12
Try:

oWord.Activedocument.Range(lnStart,lnEnd).copy

or after select:

oWord.Selection.copy

>Thanks, that works great in selecting the page, but it does not copy to clipboard <s>
>
>tried
>oWord.Activedocument.Range(lnStart,lnEnd).Selection.copy()
>
>but that reports an error that selection is not an object or such
>
>
>Peter
>
>>Something like this:
>>
>>=YSelectOnePage(4)  && paste text from page 4 into the text file c:\hi.txt
>>
>>Procedure YSelectOnePage
>>lParameter pnPage
>>oWord = Getobject(,"Word.Application")
>>lnPageCount=oWord.ActiveDocument.ComputeStatistics(2)
>>with oWord.Selection
>>	if lnPageCount<pnPage
>>		* error message go here
>>	else
>>		.GoTo(,,,pnPage)
>>		lnStart=.Range.Start
>>		if lnPageCount >pnPage
>>			.GoToNext(1)
>>			lnEnd=.Range.Start - 1
>>		else
>>			.Endkey(6)
>>			lnEnd=.Range.Start
>>		endif
>>		oWord.Activedocument.Range(lnStart,lnEnd).Select
>>		>                =strtofile(_cliptext,"c:\hi.txt")
>>				>	endif
>>endwith
>>
>>oWord=.NULL.
>>release oWord
>>
>>
>>
>>>I need to read a word document one page at a time
>>>
>>>How can I retrieve a word page into the clipboard so I can paste it into another application?
>>>
>>>
>>>Thanks
>>>
>>>
>>>Peter
Previous
Reply
Map
View

Click here to load this message in the networking platform