Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cant get Word97 Replace All to work
Message
From
28/01/1999 12:17:07
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00181347
Message ID:
00181398
Views:
12
>>>You could use the dialog.
#define wdDialogEditReplace 117
>><b>with loWord
>>*...</b>
>>>with .dialogs(wdDialogEditReplace)
>>>	.Find = "#$@"
>>>	.Replace = "13" && If you mean chr(13) then "^p"
>>>	.MatchCase = .f.
>>>	.ReplaceAll = .t.
>>>	.Execute
>>>endwith
>><b>endwith</b>
Cetin
>
>I Just inserted the code and no luck, the same results. The program finishes, but the text is not changed. I have loWord.visible = .T. so I can see the word scripts executing, but I dont see any dialog to do the replace, the data gets entered OK, but the text does not get replaced. Any other suggestions?
Brett,
Which dialog ? This doesn't show up the dialog just fill and execute it.
I think it doesn't get replaced because the selection is not in correct place.
use home()+"samples\data\customer"		&& test table
application.datatoclip()
wait window nowait "Creating Word Document..."

oWord=createobject("word.application")	&& Create word object
with oWord
	.visible = .t.				&& Show word app
	.documents.add 				&& New file, default template
	.Selection.Paste
	.Selection.Goto(-1,,,"\StartOfDoc")
	#define wdDialogEditReplace 117
	with .dialogs(wdDialogEditReplace)
		.Find = "Owner"
		.Replace = "Çetin"
		.MatchCase = .f.
		.ReplaceAll = .t.
		.Execute
	endwith
*!*		with .wordbasic && Word.basic equiavalant
*!*		.startofdocument			&& Go to start
*!*		.EditFindClearFormatting		&& Start a find&replace
*!*		.editfind("Owner","Boss",0,0,0,0,0,0,,1,,1) 
*!*  && Replace "Owner" with "Boss"
*!*		endwith
endwith
wait clear
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform