Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Word97
Message
 
To
13/12/2000 04:18:54
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Re: Word97
Miscellaneous
Thread ID:
00452771
Message ID:
00452793
Views:
23
>Can anyone tell me how to perform the following functions using the Word 97 API:
>
>New line
>Inserting Text
>Inserting Tabs
>Making text underline
>New Page
>
>Thanks in advance
>Kev

*Once you have a reference to word
oWord = CREATEOBJECT("Word.application")

* Go to top of document
oWord.SELECTION.HomeKey(6)

* Add text
oWord.SELECTION.TypeText("NUMBER")

* Insert a break for the new page to be at
oWord.SELECTION.InsertBreak(7)

* Underline the word number once I have a selection (yes you can use a range)
oWord.SELECTION.FONT.UNDERLINE = 1
oWord.SELECTION.TypeText("NUMBER")
* Turn it off
oWord.SELECTION.FONT.UNDERLINE = 0

I would reccommend getting the Word Constants to use for the above numbers. You can find the files in the file download section. If you cant let me know and I will email them to you.

As for a TAB I have never done one yet, but I would guess you just print the CHR() value for a tab from VFP.

HTH
Bret Hobbs

"We'd have been called juvenile delinquents only our neighborhood couldn't afford a sociologist." Bob Hope
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform