Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Word.basic
Message
From
25/06/1999 19:37:45
 
 
To
25/06/1999 02:42:25
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
Miscellaneous
Thread ID:
00232735
Message ID:
00234265
Views:
33
>Word.basic was used by version 7.0 and earlier. Version 8 (word97) uses word.application. Word.application itself has a wordbasic object and that means you could use word.basic commands in a word.application (not all of them really). Instantiating and using word.basic has the advantage that you wouldn't need to check version most of the time and would work for word95&word97.
>
oWord = createobject("word.basic")
>with oWord
>* Word.basic commands compatible to both versions
>
>oWord = createobject("Word.application")
>with oWord
>*VBA specific commands
>   with .wordbasic   && Use its wordbasic object
>     * Word.basic commands compatible to both versions
Now for your original question, here is a sample that would find bold and convert to nonbold, red, 20 points, wingdings :
lcInfile = getfile("doc")
>IF !empty(lcInfile)
>
>  PUBLIC oWordDocument
>  *** set the LOCALEID to English
>  nlLocaleId=sys(3004)	&& Save local id
>  =sys(3006,1033)	&& We will be sending instructions in English
>
>  oWordDocument=getobject("","word.basic")	&& Create word object
>  WITH oWordDocument
>    .appshow
>    .fileopen(lcInfile)  && Open file
>    .StartOfDocument	 && Go to start
>    .EditFindClearFormatting	&& Start a find&replace
>    .EditFindFont(,,,,,,,,,,,,,,,,1) && Find bold
>* Replace with 20 points, underline, red, wingdings, remove bold
>    .EditReplaceFont(20,1,6,,,,,,,,,,,,,"Wingdings",0) && Set replacement font
>    .EditReplace("","",0,,,,,,0,1,1,0)  && Do replacement
>*    .editselectall
>  ENDWITH
>  Release oWordDocument
>
>  **** Set the LocaleId to the previous value
>  =sys(3006,val(nlLocaleId))
>ENDIF
This word.basic code is compatible with word95&97.
>Cetin
Cetin,

Good help is always very valuable, that's what I needed to know THANKS!!
An Intelligent fool can make things bigger and more complex... It takes a touch of a genius -and a lot of courage- to move in the opposite direction".
-Albert Einstein
Previous
Reply
Map
View

Click here to load this message in the networking platform