Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Word select replace
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 8 SP1
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01028366
Message ID:
01029018
Views:
16
This message has been marked as the solution to the initial question of the thread.
Kevin,

Something like this:
oword=GETOBJECT(,"Word.application")
oWord.Selection.Find.Text = "Description"
IF NOT oWord.Selection.Find.Execute()
	oword=null
	RETURN
endif

wdGoToLine = 3
wdLine = 5
wdExtend = 1

WITH oWord.Selection
	.GoTo(wdGoToLine, ,.Information(10) - 1)
	FOR ia=1 to 3
		.EndKey(wdLine, wdExtend)
		.Delete
	ENDFOR	
ENDWITH
oword=null
RETURN
>I have a vfp app that uses a word template. It searches and replaces fields in the word doc fine. I now have a section that under some circumstances needs to be removed. I can find and replace the text with an empty string, but I need to completely remove the line AND the blank line above and below. I've done this before, but I am not having any luck today.
>Thanks,
>Kevin
Previous
Reply
Map
View

Click here to load this message in the networking platform