Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Insert Word into VFP as wordprocessor
Message
From
05/09/2003 06:59:40
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
04/09/2003 22:17:26
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00826267
Message ID:
00826327
Views:
24
>Hi all
>
>I have a question.
>
>Is it possible to insert intoi a VFP form an instance of MS Word (like an activex) so that the VFP app acts like a word processor?
>
>I know how to create an external instance of Word using CREATEOBJECT and then making it Visible. But this opens a session of word in its own window.
>
>I want to open it within the VFP _Screen or in a VFP form.
>
>I tried using INSERTOBJECT("myword","word.document.8") but this just gives me the ability to edit the document, not save it!
>
>What I need is some way of using word in VFP so that VFP now has its own word processor!
>
>Thanks
>
>Bernard

Bernard,
There is at least one way but I'm not sure it's worth the trouble. Word is not as flexible as excel when doing this (you can show excel menu and toolbars easily but I couldn't with word - meaning you would create your own toolbar if you can't either) :
oForm = Createobject('myForm')
oForm.Show
Read Events

Define Class myForm As Form
  Height = 600
  Width = 800

  Add Object wbrowser	As OleControl ;
    with top = 10, Height = 550, Width = 800, ;
    OleClass = 'Shell.Explorer'

  Procedure Init
      Local lcDoc, oWord
      lcDoc = Sys(5)+Curdir()+'myBase.Doc'
      StrToFile('',lcDoc)	
      With This.wbrowser
       .Silent = .t.
       .Navigate2(lcDoc)
       DO while .ReadyState # 4
       EndDo
      EndWith
  EndProc
  
  Procedure wbrowser.Refresh
    Nodefault
  Endproc

  Procedure QueryUnload
    Clear Events
  Endproc
Enddefine
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform