Mini Kabibi Habibi

Current Path : C:/Users/ITO/Desktop/VF9/program files/microsoft visual foxpro 9/samples/solution/ole/
Upload File :
Current File : C:/Users/ITO/Desktop/VF9/program files/microsoft visual foxpro 9/samples/solution/ole/oleword.sct

�VERSION =   3.00dataenvironmentdataenvironmentDatanavigationName = "Datanavigation"
12formformForm1�DataSession = 2
Height = 228
Width = 433
DoCreate = .T.
AutoCenter = .T.
Caption = "Automate a Microsoft Word Document in a Form"
MaxButton = .F.
HelpContextID = 117
Name = "Form1"
@PROCEDURE Error
Parameters nError, cMethod, nLine

ENDPROC
PROCEDURE Activate
THIS.c_solutions1.saveHelp
ENDPROC
PROCEDURE Deactivate
IF TYPE("THIS.c_solutions1") = "O" THEN
	THIS.c_solutions1.restoreHelp
ENDIF
ENDPROC
PROCEDURE Init
IF  fontmetric(1, 'MS Sans Serif', 8, '') # 13 OR ;
	fontmetric(4, 'MS Sans Serif', 8, '') # 2 OR ;
	fontmetric(6, 'MS Sans Serif', 8, '') # 5 OR ;
	fontmetric(7, 'MS Sans Serif', 8, '') # 11
	this.setall('fontname', 'Tahoma')  
ELSE
	this.setall('fontname','MS Sans Serif')
ENDIF
this.setall('fontsize',8)


ENDPROC
��� ��`%hH�U4����UNERRORCMETHODNLINE
�����UTHISC_SOLUTIONS1SAVEHELP9%%�C�THIS.c_solutions1b�O��2�
������UTHISC_SOLUTIONS1RESTOREHELP	�%�C��
MS Sans Serif���$�
�!C��
MS Sans Serif���$��!C��
MS Sans Serif���$��!C��
MS Sans Serif���$�����!��C�fontname�Tahoma�������(��C�fontname�
MS Sans Serif�������C�fontsize�����UTHISSETALLError,��ActivateZ��
Deactivate���Init���1�3�2Q�A2d	��A�34Sm��	�5
)�behindscenes..\solution.vcx
commandbutton
Behindscenes1Form1<Top = 199
Left = 12
TabIndex = 1
Name = "Behindscenes1"
c_solutions..\solution.vcxcustomC_solutions1Form1FTop = 201
Left = 52
Height = 18
Width = 25
Name = "C_solutions1"

commandbutton
commandbuttonCommand3Form1�Top = 199
Left = 260
Height = 23
Width = 72
FontName = "MS Dialog Light"
FontSize = 8
Caption = "Run Example"
TabIndex = 2
Name = "Command3"
.PROCEDURE Click
#DEFINE CRLF 	CHR(13)+CHR(10)
#DEFINE C_MESS1_LOC		"Is this a snowy day?"
#DEFINE C_MESS2_LOC		"Is this a rainy day?"
#DEFINE C_MESS3_LOC 	"Is this a sunny day?"

lWord97 = .T.
nMouseRow = MROW()
nMouseCol = MCOL()
oForm = THISFORM

oForm.addobject('oWordDoc','olecontrol','word.document')

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)

IF TYPE("oForm.oWordDoc.object.name") # "C"
	lWord97 = .F.
	oWordRef = GetObject('','word.basic')
ENDIF

MOUSE CLICK AT 1,1
MOUSE AT m.nMouseRow,m.nMouseCol

IF m.lWord97
	oForm.oWordDoc.object.content = C_MESS1_LOC+CRLF
	oForm.oWordDoc.object.content.insertafter(C_MESS2_LOC+CRLF)
	oForm.oWordDoc.object.content.insertafter(C_MESS3_LOC)
	oForm.oWordDoc.object.content.Font.Bold = .T.
	oForm.oWordDoc.object.content.Font.Size = 18
	oForm.oWordDoc.object.content.Font.Name = "Arial"
	oForm.oWordDoc.object.content.Font.ColorIndex = 5
ELSE
	oWordRef.Insert(C_MESS1_LOC+CRLF)
	oWordRef.editselectall
	oWordRef.Font("Arial",18)
	oWordRef.Bold
	oWordRef.EditGoTo("\EndofDoc")
	oWordRef.WordLeft(4)
	oWordRef.SelectCurWord
	oWordRef.CharColor(2)

	oWordRef.EditGoTo("\EndofDoc")
	oWordRef.Insert(C_MESS2_LOC)
	oWordRef.WordLeft(3)
	oWordRef.SelectCurWord
	oWordRef.CharColor(4)
	oWordRef.Bold(0)

	oWordRef.EditGoTo("\StartofDoc")
	oWordRef.Insert(C_MESS3_LOC+CRLF)
	oWordRef.WordLeft(4)
	oWordRef.SelectCurWord
	oWordRef.CharColor(6)
	oWordRef.Bold(0)
	oWordRef.Italic

	oWordRef.editselectall
	oWordRef.shadingpattern(2)
	oWordRef.borderoutside()
	oWordRef.borderlinestyle(7)
ENDIF

THIS.ENABLED = .F.
ENDPROC
��� ���%�8$�U�T��a��T��C��T��C��
T�����5��C�oWordDoc�
olecontrol�
word.document����T���������T���	����	��T���
����
��T���������T����a��
���
���C������.%�C�oForm.oWordDoc.object.nameb�C��M�T��-��T��C��
word.basic�\���������������
����
���%��
�����6T������Is this a snowy day?C�
 C�
 ��9��C�Is this a rainy day?C�
 C�
 �������-��C�Is this a sunny day?�������T�������a��T����������!T��������Arial��T�����������x�0��C�Is this a snowy day?C�
 C�
 ����
������C�Arial�����
������C�	\EndofDoc������C�����
������C�������C�	\EndofDoc����$��C�Is this a rainy day?������C�����
������C�������C�������C�\StartofDoc����0��C�Is this a sunny day?C�
 C�
 ������C�����
������C�������C�����
����
������C�����
��C�� ����C���!���T�"�#�-��U$LWORD97	NMOUSEROW	NMOUSECOLOFORMTHISFORM	ADDOBJECTOWORDDOCHEIGHTTXTFRAMEWIDTHTOPLEFTVISIBLESHOWDOVERBOWORDREFOBJECTCONTENTINSERTAFTERFONTBOLDSIZENAME
COLORINDEXINSERT
EDITSELECTALLEDITGOTOWORDLEFT
SELECTCURWORD	CHARCOLORITALICSHADINGPATTERN
BORDEROUTSIDEBORDERLINESTYLETHISENABLEDClick,��1����R�����1���AA�a������������A������A�1#)�cmdclose..\solution.vcx
commandbutton	Cmdclose1Form1RTop = 199
Left = 351
Height = 23
Width = 72
TabIndex = 3
Name = "Cmdclose1"
shapeshapeShape2Form1bTop = 14
Left = 11
Height = 55
Width = 413
BackStyle = 0
SpecialEffect = 0
Name = "Shape2"
labellabelLabel5Form1SFontName = "MS Sans Serif"
FontSize = 8
WordWrap = .T.
Caption = "To embed a Microsoft Word document in a Visual FoxPro OLE container control and then change the Word document programmatically, click Run Example.  (You must have Microsoft Word installed.)"
Height = 41
Left = 20
Top = 23
Width = 398
TabIndex = 0
Name = "Label5"
labellabelLabel6Form1�AutoSize = .T.
FontName = "MS Sans Serif"
FontSize = 8
Caption = " Instructions "
Height = 15
Left = 19
Top = 8
Width = 62
TabIndex = 0
Name = "Label6"
textboxtextboxtxtFrameForm1pEnabled = .F.
Height = 116
Left = 11
ReadOnly = .T.
TabIndex = 0
Top = 76
Width = 411
Name = "txtFrame"
uArial, 0, 9, 5, 15, 12, 32, 3, 0
MS Dialog Light, 0, 8, 5, 13, 11, 11, 2, 0
MS Sans Serif, 0, 8, 5, 13, 11, 11, 2, 0
�DataSession = 2
Height = 228
Width = 433
DoCreate = .T.
AutoCenter = .T.
Caption = "Automate a Microsoft Word Document in a Form"
MaxButton = .F.
HelpContextID = 1231541
Name = "Form1"