Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Simple Word Commands -- Bold, Underline, PageBreak??
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00329050
Message ID:
00329883
Views:
19
>**You don't need resource material. Just create a macro in the application your interested in and view the macro source. pf**
>
>**#DEFINE WDPAGEBREAK 7
>oWord.Selection.InsertBreak( WDPAGEBREAK)
>oWord.Selection.Font.Bold = .T.
>José**
>
>**********
>Good Advice and help. I did the macro thing and had some trial and error getting the vb converted to fox such as:
>VB: Selection.InsertBreak Type:=wdPageBreak
>Fox: oword.SELECTION.InsertBreak(wdPageBreak)
>
>But overall OK.
>
>1.) I did read where someone said that .insertafter is faster then .typetext and while this could be true (both seem slow) I noticed that typetext seem to be easier to use with formatting. The insertafter seems to be controlled by the formatting of the underlying template (normal.dot) while the typetext respects whatever setting you define as you go along.
>
>2.) Both insertafter and typetext bomb out when you pass more then 254 characters. Wrote a function to parse into 254 character segments.` If you are interested:
>
>=Only254(lctextString)
>
>*****************************************************
>FUNCTION Only254
>
>LPARAMETERS lcTextString
>local lnCounter, i
>lnCounter=int(len(lcTextString)/254)
>lnMod= mod(len(lcTextString),254)
>IF lnMod>0
> lnCounter=lnCounter+1
>ENDIF
>FOR i=1 to lnCounter
>
> lctexti = substr(lcTextString,(((i-1)*254)+1),254)
> oword.selection.typetext(lctexti)
>
>ENDFOR
>
>Kevin

Kevin,

Instead of doing so much work cutting strings into pieces, you might think of using bookmarks in your word document. You can place a lot of text into a bookmark: don't know the limit, but it's more than several pages.

José
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform