Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Display word document in vfp form
Message
 
To
19/11/2007 11:16:19
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01269917
Message ID:
01269948
Views:
30
Try this:
PUBLIC oform1
oform1=NEWOBJECT("form1")
oform1.Show
RETURN
DEFINE CLASS form1 AS form
      Top = 0
      Left = 0
      Height = 245
      Width = 440
      DoCreate = .T.
      Caption = "Form1"
      Name = "Form1"
      ADD OBJECT command1 AS commandbutton WITH ;
            Top = 204, ;
            Left = 177, ;
            Height = 25, ;
            Width = 85, ;
            Caption = "Demo Word", ;
            Name = "Command1"
      ADD OBJECT txtframe AS textbox WITH ;
            Enabled = .F. ;
            Height = 116, ;
            Left = 24, ;
            ReadOnly = .T. ;
            TabIndex = 0, ;
            Top = 36, ;
            Width = 399, ;
            Name = "txtFrame"
      PROCEDURE command1.Click
            lcDoc = GETFILE('doc')
            oForm = THISFORM
            IF Vartype(oForm.oWordDoc)="O" && Suggéré par Thierry
                 oForm.removeObject("oWordDoc")
                 CLEAR CLASS oleWordObject && pour lassurer la ré-évaluation de DocumentFile
            ENDIF
            oForm.AddObject('oWordDoc','oleWordObject')
            oForm.oWordDoc.Height =  THISFORM.txtFrame.height
            oForm.oWordDoc.Width =  THISFORM.txtFrame.width
            oForm.oWordDoc.Top =  THISFORM.txtFrame.top
            oForm.oWordDoc.Left =  THISFORM.txtFrame.left
            oForm.oWordDoc.Visible =  .t.
            oForm.Show
            oForm.oWordDoc.DoVerb(0)
      ENDPROC
ENDDEFINE
DEFINE CLASS oleWordObject as OLEControl
   OleClass ="Word.Document"  
   DocumentFile = lcDoc
ENDDEFINE
>Hello all,
>
>I have a simple word document ( a sort of software manual ) that i want to put it in my vfp application menu. i.e. i will have this word file by users machine somewhere and now if user clicks on help/manual then i want to display contents of this word document.
>
>what would be the simplest way to do this? i want to avoid using any activex controls if possible to reduce distribution problems.
>
>thank you very much for help in advance.
Previous
Reply
Map
View

Click here to load this message in the networking platform