Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to copy a general memo back to a original file eg WO
Message
De
14/10/1998 02:55:14
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
14/10/1998 02:07:58
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00146503
Message ID:
00146519
Vues:
23
>Hello all,
>
>How can I copy a general memo, containing for example a WORD file, to a WORD file again ??
>
>Thanks
>Xavier
>
>X.D.Technology cc
>Software Development
create cursor wtest (wf g)
append blank
append general wf from ("c:\my documents\mytest.doc")
oform = createobject("form")
with oForm
  .addobject("olbW","Oleboundcontrol")
  .height = 420
  .width = 620
  with .olbW
	.top = 10
	.left = 10
	.height = 400
	.width = 600
	.controlsource = "wtest.wf"    		&& Embedded word doc
	.object.saveas("c:\temp\savedfromgen.doc")  && saved to disk
  endwith	
  .removeobject("olbW")
  .AddObject('cmdCommand1','cmdMyCmdBtn')  && Add Command button
  .AddObject("oleObject","oleWordObject")  && Add OLE object
  .cmdCommand1.Visible=.T.		&& Display the "Quit" Command button
  .oleObject.DoVerb(-1)			&& -1 for Edit
  .Show					&& Display the form
endwith	
READ EVENTS	&& Start event processing

DEFINE CLASS oleWordObject as OLEControl
	OleClass ="Word.document.8"			&& Server name
	OleTypeAllowed = 0 					&& Linked
	DocumentFile = "C:\temp\savedfromgen.doc"	&& This file would be created from embedded
ENDDEFINE

DEFINE CLASS cmdMyCmdBtn AS CommandButton  && Create Command button
	Caption = '\<Quit'  && Caption on the Command button
	Cancel = .T.  && Default Cancel Command button (Esc)
	Left = 1  && Command button column

	Top = 1  && Command button row
	Height = 25  && Command button height

	PROCEDURE Click
		CLEAR EVENTS  && Stop event processing, close form
ENDDEFINE
After first endwith, rest is to show you really saved the doc. Even just remout .show and read events so form wouldn't show at all.
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform