Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using Word 97 Ole Automation Commands in Visual Fox
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00085204
Message ID:
00097984
Views:
37
>Hello All, > >Recently, I have been trying to control Word 97 from Visual Foxpro 5.0 using Word as an OLE Automation Server, and I have had limited success at best in controlling the Word application. > >More specifically, I have been unable to change the properties of the current selection, such as turning the Bold property on and off, or the orientation property of the current document. > >I have used the following code to try changing the font to Bold: > >OWord = CreateObject("word.basic.8") >OWord.FileNew() >OWord.Insert("This is the non-bolded text") >OWord.selection.font.bold = .T. >OWord.Insert("This is the bolded text") > >This code bombs on the fourth line with an OLE error of "Unknown Name". > >What am I doing wrong? Does anyone know a list of Word 97 Visual Basic functions that directly translate in Visual Fox 5? > >Thanks in advance, > >Ben Holton Hi, You probably have to use a number corresponding to words "True". Word does not use .T. Klas Nygren [ ...and GMRider added: ] Well, on MSWord in Office 98, it sure does if you use syntax similar to the following: ox.Selection.Font.Bold = .T. - where 'ox' = a handle to an object created earlier...
The Computer and Communications Company
Previous
Reply
Map
View

Click here to load this message in the networking platform