Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Word 97 Automation via VFP
Message
From
07/03/1998 23:10:25
Bob Thickens
Empire Medical Review Services, Inc
Mequon, Wisconsin, United States
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00083062
Message ID:
00083251
Views:
28
in olespeak it can be done with the following commands:
objXLsheet=CreateObject("Excel.Sheet")
objXLsheet.application.visible=.T.

see the active x samples in the vfp samples class. Open the project run the code and then view the code. hth b


>It may be crude & unsophisticated in the eye of the erudite VFP object manipulation experts, however, it works with simple ease for, & satisfaction of, our clients:
>We (MISSI) have MS Office97 developer edition software - whereas our clients have plain old Excel97, i.e. regular edition - & we send much data mined by VFP using SQL calls from the original data files, & passed into spreadsheet forms for preview & print - such as you say you want to accomplish - we do this part by calling Excel.exe in the time honored tradition of

>"RUN /N1 ...dir..\excel.exe ....dir...\whatever.xls"


>& placing all the relevant VBA commands directly into the xls file which is therefore a template for the desired report. Amongst the VBA code placed in this template are the VBA commands for hiding the excel menu bars etc & for restoring on closing. The same approach will work for Word97 or any other Office97 tool. There is a difference between 95 & 97 however as MS has tried to rationalize the use of VBA across all of the office package & so 97 commands will not all work backwards into 95 tools.
>
>We use a VFP form for input of the critical parameters to direct the initial VFP query & call the appropriate xls template. AS I said, crude but effective & quick - we don't need to prove brilliance at object manipulation but we do need to produce acceptable output for the clients & they like the results. verb sap, as my old High schol latin teacher used to say. :)) HTH. /psb
>
>>>I'm having difficulty finding documentation that deals with Word 97 Automation from VFP. Much of what I find refers to the "Word.basic" object and not the "Word.application" which Word 97 uses.
>>>
>>>What I'm most interested in doing is the following:
>>>-------------------------------------------------------------
>>>(1) Disabling and/or removing entire Word pulldown menus (e.g. "File", "View"
>>>
>>>(2) Changing the name of a menu entry (e.g. instead of "Save" I want it to say "Update"
>>>
>>>(3) Adding a new pulldown menu to the Menu bar
>>>
>>>(4) Removing the Menu bar alltogether. This would be for a situation in which I have a document I want to allow people to only view and/or print. What I would want is the Print Preview screen which allows them to zoom, navigate, and print, but which doesn't have the Menu bar and, thereby, doesn't allow them to save or modify the document.
>>>
>>>Any info you could give me, either firsthand knowledge or referrals to on-line documentation, would be greatly appreciated.
>>>
>>>Thanks!
>>
>>The book we have here is: Microsoft OFFICE97/Visual Basic Programmer's Guide, by M$ Press, ISBN 1-57231-340-4. I have not read it, or personally messed with OLE, though I will eventually. But I have seen people here saying that many Word97 VBA functions just don't work when called from VFP. They say that WordBasic commands, or most of them, from Word95, are supported by Word97, though the fact isn't documented. People are often using WordBasic for that reason, and also, I suppose, because they already know it, have already written the code, and continue to support Word95 users. People here also say that Excel97 VBA works great.
>>
>>That's second hand advice from me. Maybe someone else will give it to you first hand.
Previous
Reply
Map
View

Click here to load this message in the networking platform