Home » Developer & Programmer » Forms » Insert picture (split from unrelated thread)
|
|
|
Re: Insert picture (split from unrelated thread) [message #544602 is a reply to message #544572] |
Wed, 22 February 2012 18:26 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.gravatar.com/avatar/1229663c86eb1a441385fe710cd9116e?s=64&d=mm&r=g) |
mughals_king
Messages: 392 Registered: January 2012 Location: pakistan
|
Senior Member |
|
|
I created the code in a procedure in program units and calling in forms:Here is the whole Code:
PROCEDURE Pr_Ole2_Word_Doc ISV_Application Ole2.Obj_Type;
V_Documents Ole2.Obj_Type;
V_Document Ole2.Obj_Type;
V_Selection Ole2.Obj_Type;
V_Range Ole2.Obj_Type;
V_Tables Ole2.Obj_Type;
V_Table Ole2.Obj_Type;
V_Cells Ole2.Obj_Type;
V_Rows Ole2.Obj_Type;
V_Column Ole2.Obj_Type;
V_Shading Ole2.Obj_Type;
V_ParagraphFormat Ole2.Obj_Type;
V_Font Ole2.Obj_Type;
V_Window Ole2.Obj_Type;
V_Pane Ole2.Obj_Type;
V_View Ole2.Obj_Type;
V_Fields Ole2.Obj_Type;
V_Args Ole2.List_Type;
V_Pagesetup Ole2.Obj_Type;
V_InlineShapes Ole2.Obj_Type;
V_CellColumn CONSTANT NUMBER(3):= 0;
WdSeekCurrentPageHeader
CONSTANT NUMBER(3):=9;
WdSeekCurrentPageFooter
CONSTANT NUMBER(3):=10;
WdSeekMainDocument
CONSTANT NUMBER(3):=0;
WdFieldPage CONSTANT NUMBER(3):= 33;
WdFieldNumPages CONSTANT NUMBER(3):=26;
WdPageBreak CONSTANT NUMBER(3):=7;
WdStory CONSTANT NUMBER(3):=6;
-- wdDefaultTableBehavior Class members
WdWord8TableBehavior
CONSTANT NUMBER(5):=0;--Default
WdWord9TableBehavior
CONSTANT NUMBER(5):= 1;
--wdAutoFitBehavior Class members
--(only works when DefaultTableBehavior=wdWord9TableBehavior)
WdAutoFitContent
CONSTANT NUMBER(5):= 1;
WdAutoFitFixed
CONSTANT NUMBER(5) := 0;
WdAutoFitWindow
CONSTANT NUMBER(5) := 2;
-- wdUnits Class members
WdCell
CONSTANT NUMBER(5):=12;
WdCharacter
CONSTANT NUMBER(5):=1;--Default
WdWord
CONSTANT NUMBER(5) := 2;
WdSentence
CONSTANT NUMBER(5):= 3;
WdLine
CONSTANT NUMBER(5):= 5;
---- wdMovementType Class members
WdExtend
CONSTANT NUMBER(5):=1;
WdMove
CONSTANT NUMBER(5):= 0;--Default
----WdParagraphAlignment Class members
WdAlignParagraphCenter
CONSTANT NUMBER(5):=1;
WdAlignParagraphLeft
CONSTANT NUMBER(5):=0;
WdAlignParagraphRight
CONSTANT NUMBER(5):=2;
V_Footer VARCHAR2(1000);
V_Cnt NUMBER := 0;
V_Cnt_Brk NUMBER := 1;
V_Brk NUMBER := 0;
V_File_Name VARCHAR2(100);
V_Print_Logo VARCHAR2(100);
Err_code BINARY_INTEGER;
Err_text VARCHAR2(255);
CURSOR c1 IS
SELECT Line_No,
Benefit_Line,
Cost ,Guaranteed,
Expected,
Row_type
FROM EMP WHERE
Line_No >= 2
ORDER BY Line_No;
BEGIN
----Invoke A word document
V_Application:=
Ole2.Create_Obj
('Word.Application');
Ole2.Set_Property
(V_Application,
'Visible', 1);
V_Documents:=
Ole2.Get_Obj_Property
(V_Application,'Documents');
V_Document:=
Ole2.Invoke_Obj
(V_Documents,'Add');
----Get window pane to insert into Header and Footer
V_Window:=
Ole2.Get_Obj_Property
(V_Application,
'ActiveWindow');
V_Pane:=
Ole2.Get_Obj_Property
(V_Window,'ActivePane' );
V_View:=
Ole2.Get_Obj_Property
(V_Pane,'View' );
----Header Section
Ole2.Set_Property
(V_View, 'SeekView',
WdSeekCurrentPageHeader);
V_Selection:=
Ole2.Get_Obj_Property
(V_Application,'Selection');
SELECT Benefit_Line,
Cost INTO V_Print_Logo,
V_File_Name
FROM EMP
WHERE Line_No = 1;
----Insert image in Header Section
IF V_Print_Logo =
'PRINT_LOGO=Y' THEN
V_ParagraphFormat:=
Ole2.Get_Obj_Property
(V_Selection, 'ParagraphFormat');
Ole2.Set_Property
(V_ParagraphFormat,'Alignment',
WdAlignParagraphRight);
Ole2.Release_Obj
(V_ParagraphFormat);
V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg (V_Args, 'C:\ss1wpp\Oracle\Images\cambridge.jpg');
InlineShapes:=
Ole2.Get_Obj_Property
(V_Selection,'InlineShapes');
Ole2.Invoke(InlineShapes,'AddPicture',V_Args);
Ole2.Destroy_Arglist(V_Args);
ELSE V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg(V_Args, '');
Ole2.Invoke(V_Selection, 'TypeText', V_Args);
Ole2.Destroy_Arglist(V_Args);
END IF;
----- Footer Section
SELECT Benefit_Line INTO
V_Footer FROM EMP
WHERE Line_No =(
SELECT MAX(line_no)
FROM EMP);
V_File_Name:=
'C:\Proposals\'||:Global.User_Name||
'\'||V_File_Name||'.doc';
Ole2.Set_Property
(V_View, 'SeekView',wdSeekCurrentPageFooter);
V_ParagraphFormat:=
Ole2.Get_Obj_Property
(V_Selection, 'ParagraphFormat');
Ole2.Set_Property
(V_ParagraphFormat,'Alignment', wdAlignParagraphleft);
Ole2.Release_Obj
(V_ParagraphFormat);
V_Fields := Ole2.Get_Obj_Property(V_Selection,'Fields');
V_Font := Ole2.Get_Obj_Property(V_Selection, 'Font'); Ole2.Set_Property(V_Font, 'Name', 'Times New Roman');
Ole2.Set_Property(V_Font, 'Size', 10);
Ole2.Set_Property(V_Font, 'Bold', FALSE );
Ole2.Set_Property(V_Font, 'Italic', TRUE );
V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg (V_Args, V_Footer);
Ole2.Invoke (V_Selection, 'TypeText', V_Args);
Ole2.Destroy_Arglist(V_Args);
Ole2.Set_Property(V_View,'SeekView',wdSeekMainDocument);
Ole2.Release_Obj (V_View);
Ole2.Release_Obj (V_Pane);
Ole2.Release_Obj (V_Window);
----end of footer and header
----Create Table
V_Selection:= Ole2.Get_Obj_Property(V_Application,'Selection');
V_Tables:= Ole2.Get_Obj_Property(V_Document,'Tables' );
V_Pagesetup := Ole2.Get_Obj_Property(V_Document ,'PageSetup' );
V_Range := Ole2.Get_Obj_Property(V_Selection, 'Range'); Ole2.Set_Property(V_Pagesetup,'leftmargin',65);
Ole2.Set_Property(V_Pagesetup,'rightmargin',51);
V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg_OBJ(V_Args, V_Range);--Range
Ole2.Add_Arg(V_Args, 26);--NumRows
Ole2.Add_Arg(V_Args, 4);--NumColumns
Ole2.Add_Arg(V_Args,wdWord8TableBehavior);--DefaultTableBehavior
Ole2.Add_Arg(V_Args,wdAutoFitContent);--AutoFitBehavior
V_Table := Ole2.Invoke_OBJ(V_Tables, 'Add', V_Args); Ole2.Destroy_Arglist(V_Args);
Ole2.Release_Obj(V_Table);
Ole2.Release_Obj(V_Range);
Ole2.Release_Obj(V_Pagesetup);
Ole2.Release_Obj(V_Tables);
----End Of Table
----After Creating Table Set the column width
V_Column := Ole2.Get_Obj_Property(V_Selection, 'Columns'); Ole2.Set_Property(V_Column, 'Width', 200);
V_Args := Ole2.Create_Arglist;Ole2.Add_Arg(V_Args, '');
Ole2.Invoke(V_Selection, 'TypeText', V_Args); Ole2.Destroy_Arglist(V_Args);
V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg(V_Args, wdCell);
Ole2.Add_Arg(V_Args, 1);
Ole2.Add_Arg(V_Args, wdMove);
Ole2.Invoke(V_Selection, 'MoveRight', V_Args); Ole2.Destroy_Arglist(V_Args);
V_Column := Ole2.Get_Obj_Property(V_Selection, 'Columns'); Ole2.Set_Property(V_Column, 'Width', 105);
V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg(V_Args, '');
Ole2.Invoke(V_Selection, 'TypeText', V_Args); Ole2.Destroy_Arglist(V_Args);
V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg(V_Args, wdCell);
Ole2.Add_Arg(V_Args, 1);
Ole2.Add_Arg(V_Args, wdMove);
Ole2.Invoke(V_Selection, 'MoveRight', V_Args); Ole2.Destroy_Arglist(V_Args);
V_Column := Ole2.Get_Obj_Property(V_Selection, 'Columns'); Ole2.Set_Property(V_Column, 'Width', 105);
V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg(V_Args, '');
Ole2.Invoke(V_Selection, 'TypeText', V_Args); Ole2.Destroy_Arglist(V_Args);
V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg(V_Args, wdCell);
Ole2.Add_Arg(V_Args, 1);
Ole2.Add_Arg(V_Args, wdMove);
Ole2.Invoke(V_Selection, 'MoveRight', V_Args); Ole2.Destroy_Arglist(V_Args);
V_Column := Ole2.Get_Obj_Property(V_Selection, 'Columns'); Ole2.Set_Property(V_Column, 'Width', 105);
V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg(V_Args, '');
Ole2.Invoke(V_Selection, 'TypeText', V_Args); Ole2.Destroy_Arglist(V_Args);
V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg(V_Args, wdCell);
Ole2.Add_Arg(V_Args, 1);
Ole2.Add_Arg(V_Args, wdMove);
Ole2.Invoke(V_Selection, 'MoveRight', V_Args);
Ole2.Destroy_Arglist(V_Args);
----End For column width
SELECT MAX(line_No) INTO V_Cnt FROM EMP;
SELECT COUNT(1) INTO V_Brk FROM EMP
WHERE Benefit_Line Like 'PAGE%';
FOR i IN C1 LOOP IF i.Line_No = V_Cnt THEN
Null;
ELSIF i.Benefit_Line = 'PAGEBREAK' THEN
IF V_Cnt_Brk <
V_Brk THENV_Args:=
Ole2.Create_Arglist;
Ole2.Add_Arg(V_Args, wdPageBreak);
Ole2.Invoke(
V_Selection,
'InsertBreak',
V_Args);
Ole2.Destroy_Arglist(V_Args);
V_Selection:=
Ole2.Get_Obj_Property
(V_Application, 'Selection');
V_Tables:=
Ole2.Get_Obj_Property(V_Document , 'Tables' );
V_Range := Ole2.Get_Obj_Property (V_Selection, 'Range');
rgs := Ole2.Create_Arglist;
Ole2.Add_Arg_OBJ(V_Args, V_Range);--Range
Ole2.Add_Arg(V_Args, 26);--NumRows
Ole2.Add_Arg(V_Args, 4);--NumColumns
Ole2.Add_Arg(V_Args,wdWord8TableBehavior);
--DefaultTableBehavior
Ole2.Add_Arg(V_Args, wdAutoFitContent);--AutoFitBehavior
V_Table := Ole2.Invoke_OBJ(V_Tables, 'Add', V_Args); Ole2.Destroy_Arglist(V_Args);
Ole2.Release_Obj(V_Table);
Ole2.Release_Obj(V_Range);
Ole2.Release_Obj(V_Tables);
V_Cnt_Brk := V_Cnt_Brk + 1;
V_Column := Ole2.Get_Obj_Property(V_Selection, 'Columns'); Ole2.Set_Property(V_Column, 'Width', 200);
V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg(V_Args, '');
Ole2.Invoke (V_Selection, 'TypeText', V_Args); Ole2.Destroy_Arglist(V_Args);
V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg(V_Args, wdCell);
Ole2.Add_Arg(V_Args, 1);
Ole2.Add_Arg(V_Args, wdMove);
Ole2.Invoke (V_Selection, 'MoveRight', V_Args); Ole2.Destroy_Arglist(V_Args);
V_Column := Ole2.Get_Obj_Property(V_Selection, 'Columns');
Ole2.Set_Property(V_Column, 'Width', 105);
V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg(V_Args, '');
Ole2.Invoke (V_Selection, 'TypeText', V_Args); Ole2.Destroy_Arglist(V_Args);
V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg(V_Args, wdCell);
Ole2.Add_Arg(V_Args, 1);
Ole2.Add_Arg(V_Args, wdMove);
Ole2.Invoke (V_Selection, 'MoveRight', V_Args); Ole2.Destroy_Arglist(V_Args);
V_Column := Ole2.Get_Obj_Property(V_Selection, 'Columns');
Ole2.Set_Property(V_Column, 'Width', 105);
V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg(V_Args, '');
Ole2.Invoke (V_Selection, 'TypeText', V_Args); Ole2.Destroy_Arglist(V_Args);
V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg(V_Args, wdCell);
Ole2.Add_Arg(V_Args, 1);
Ole2.Add_Arg(V_Args, wdMove);
Ole2.Invoke (V_Selection, 'MoveRight', V_Args); Ole2.Destroy_Arglist(V_Args);
V_Column := Ole2.Get_Obj_Property(V_Selection, 'Columns'); Ole2.Set_Property(V_Column, 'Width', 105);
V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg(V_Args, '');
Ole2.Invoke (V_Selection, 'TypeText', V_Args); Ole2.Destroy_Arglist(V_Args);
V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg(V_Args, wdCell);
Ole2.Add_Arg(V_Args, 1);
Ole2.Add_Arg(V_Args, wdMove);
Ole2.Invoke (V_Selection, 'MoveRight', V_Args);
Ole2.Destroy_Arglist(V_Args);
END IF;
ELSIF i.Row_Type LIKE 'M%B' THEN V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg(V_Args, wdCharacter);--Unit
Ole2.Add_Arg(V_Args, 4);--Count
Ole2.Add_Arg(V_Args, wdExtend);--Extend
Ole2.Invoke(V_Selection, 'MoveRight', V_Args); Ole2.Destroy_Arglist(V_Args);
V_Cells := Ole2.Get_Obj_Property(V_Selection, 'Cells'); Ole2.Invoke(V_Cells, 'Merge');
V_ParagraphFormat := Ole2.Get_Obj_Property(V_Selection, 'ParagraphFormat');
Ole2.Set_Property(V_ParagraphFormat, 'Alignment', wdAlignParagraphCenter);
IF i.Benefit_Line LIKE 'Date%' THEN
Ole2.Set_Property(V_Font, 'Name', 'Times New Roman');
Ole2.Set_Property(V_Font, 'Size', 12);
Ole2.Set_Property(V_Font, 'Bold', TRUE );
ELSE
Ole2.Set_Property(V_Font, 'Name', 'Times New Roman');
Ole2.Set_Property(V_Font, 'Size', 14);Ole2.Set_Property(V_Font, 'Bold', TRUE );
END IF;
V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg(V_Args, i.Benefit_Line);
Ole2.Invoke(V_Selection, 'TypeText', V_Args); Ole2.Destroy_Arglist(V_Args);
V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg(V_Args, wdCell);
Ole2.Add_Arg(V_Args, 1);
Ole2.Add_Arg(V_Args, wdMove);
Ole2.Invoke(V_Selection, 'MoveRight', V_Args); Ole2.Destroy_Arglist(V_Args);
ELSIF i.Row_Type = 'M' THEN
V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg(V_Args, wdCharacter);--Unit
Ole2.Add_Arg(V_Args, 4);--Count
Ole2.Add_Arg(V_Args, wdExtend);--Extend
Ole2.Invoke (V_Selection, 'MoveRight', V_Args); Ole2.Destroy_Arglist(V_Args);
V_Cells := Ole2.Get_Obj_Property(V_Selection, 'Cells'); Ole2.Invoke(V_Cells, 'Merge');
V_ParagraphFormat := Ole2.Get_Obj_Property(V_Selection, 'ParagraphFormat');
Ole2.Set_Property(V_ParagraphFormat, 'Alignment', wdAlignParagraphCenter);
V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg(V_Args, i.Benefit_Line);
Ole2.Invoke(V_Selection, 'TypeText', V_Args); Ole2.Destroy_Arglist(V_Args);
V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg(V_Args, wdCell);
Ole2.Add_Arg(V_Args, 1);
Ole2.Add_Arg(V_Args, wdMove);
Ole2.Invoke(V_Selection, 'MoveRight', V_Args); Ole2.Destroy_Arglist(V_Args);
ELSIF i.Row_Type IS NULL THEN
V_ParagraphFormat := Ole2.Get_Obj_Property(V_Selection, 'ParagraphFormat');
Ole2.Set_Property(V_ParagraphFormat, 'Alignment', wdAlignParagraphleft);
Ole2.Set_Property(V_Font, 'Name', 'Times New Roman');
Ole2.Set_Property(V_Font, 'Size', 11);
Ole2.Set_Property(V_Font, 'Bold', FALSE );
V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg(V_Args, i.Benefit_Line);
Ole2.Invoke(V_Selection, 'TypeText', V_Args);
Ole2.Destroy_Arglist(V_Args);
V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg(V_Args, wdCell);
Ole2.Add_Arg(V_Args, 1);
Ole2.Add_Arg(V_Args, wdMove);
Ole2.Invoke(V_Selection, 'MoveRight', V_Args); Ole2.Destroy_Arglist(V_Args);
V_ParagraphFormat := Ole2.Get_Obj_Property(V_Selection, 'ParagraphFormat');
Ole2.Set_Property(V_ParagraphFormat, 'Alignment', wdAlignParagraphright);
Ole2.Set_Property(V_Font, 'Name', 'Times New Roman');
Ole2.Set_Property(V_Font, 'Size', 11);
Ole2.Set_Property(V_Font, 'Bold', FALSE );
V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg(V_Args, i.Cost);
Ole2.Invoke(V_Selection, 'TypeText', V_Args); Ole2.Destroy_Arglist(V_Args);
V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg(V_Args, wdCell);
Ole2.Add_Arg(V_Args, 1);
Ole2.Add_Arg(V_Args, wdMove);
Ole2.Invoke(V_Selection, 'MoveRight', V_Args); Ole2.Destroy_Arglist(V_Args);V_ParagraphFormat := Ole2.Get_Obj_Property(V_Selection, 'ParagraphFormat'); Ole2.Set_Property(V_ParagraphFormat, 'Alignment', wdAlignParagraphright);
Ole2.Set_Property(V_Font, 'Name', 'Times New Roman');
Ole2.Set_Property(V_Font, 'Size', 11);
Ole2.Set_Property(V_Font, 'Bold', FALSE );
V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg(V_Args, i.Guaranteed);
Ole2.Invoke(V_Selection, 'TypeText', V_Args); Ole2.Destroy_Arglist(V_Args);
V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg(V_Args, wdCell);
Ole2.Add_Arg(V_Args, 1);
Ole2.Add_Arg(V_Args, wdMove);
Ole2.Invoke(V_Selection, 'MoveRight', V_Args); Ole2.Destroy_Arglist(V_Args);
V_ParagraphFormat := Ole2.Get_Obj_Property(V_Selection, 'ParagraphFormat');
Ole2.Set_Property(V_ParagraphFormat, 'Alignment', wdAlignParagraphright);
Ole2.Set_Property(V_Font, 'Name', 'Times New Roman');
Ole2.Set_Property(V_Font, 'Size', 11);
Ole2.Set_Property(V_Font, 'Bold', FALSE );
V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg(V_Args,i.Expected);
Ole2.Invoke(V_Selection, 'TypeText', V_Args); Ole2.Destroy_Arglist(V_Args);
V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg(V_Args, wdCell);
Ole2.Add_Arg(V_Args, 1);
Ole2.Add_Arg(V_Args, wdMove);
Ole2.Invoke(V_Selection, 'MoveRight', V_Args); Ole2.Destroy_Arglist(V_Args);
ELSIF i.Row_Type = 'B' then
V_ParagraphFormat := Ole2.Get_Obj_Property(V_Selection, 'ParagraphFormat');
Ole2.Set_Property(V_ParagraphFormat, 'Alignment', wdAlignParagraphleft);
Ole2.Set_Property(V_Font, 'Name', 'Times New Roman');
Ole2.Set_Property(V_Font, 'Size', 11);
Ole2.Set_Property(V_Font, 'Bold', TRUE );
V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg(V_Args, i.Benefit_Line);
Ole2.Invoke(V_Selection, 'TypeText', V_Args); Ole2.Destroy_Arglist(V_Args);
V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg(V_Args, wdCell);
Ole2.Add_Arg(V_Args, 1);
Ole2.Add_Arg(V_Args, wdMove);
Ole2.Invoke(V_Selection, 'MoveRight', V_Args); Ole2.Destroy_Arglist(V_Args);
V_ParagraphFormat := Ole2.Get_Obj_Property(V_Selection, 'ParagraphFormat');
Ole2.Set_Property(V_ParagraphFormat, 'Alignment', wdAlignParagraphright);
Ole2.Set_Property(V_Font, 'Name', 'Times New Roman');
Ole2.Set_Property(V_Font, 'Size', 11);
le2.Set_Property(V_Font, 'Bold', TRUE );
V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg(V_Args, i.Cost);
Ole2.Invoke(V_Selection, 'TypeText', V_Args);
Ole2.Destroy_Arglist(V_Args);
V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg(V_Args, wdCell);
Ole2.Add_Arg(V_Args, 1);
Ole2.Add_Arg(V_Args, wdMove);
Ole2.Invoke(V_Selection, 'MoveRight', V_Args); Ole2.Destroy_Arglist(V_Args);
V_ParagraphFormat := Ole2.Get_Obj_Property(V_Selection, 'ParagraphFormat');
Ole2.Set_Property(V_ParagraphFormat, 'Alignment', wdAlignParagraphright);
Ole2.Set_Property(V_Font, 'Name', 'Times New Roman');
Ole2.Set_Property(V_Font, 'Size', 11);
Ole2.Set_Property(V_Font, 'Bold', TRUE );
V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg(V_Args, i.Guaranteed);
Ole2.Invoke(V_Selection, 'TypeText', V_Args); Ole2.Destroy_Arglist(V_Args);
V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg(V_Args, wdCell);
Ole2.Add_Arg(V_Args, 1);
Ole2.Add_Arg(V_Args, wdMove);
Ole2.Invoke(V_Selection, 'MoveRight', V_Args); Ole2.Destroy_Arglist(V_Args);
V_ParagraphFormat := Ole2.Get_Obj_Property(V_Selection, 'ParagraphFormat');
Ole2.Set_Property(V_ParagraphFormat, 'Alignment', wdAlignParagraphright);
Ole2.Set_Property(V_Font, 'Name', 'Times New Roman');
Ole2.Set_Property(V_Font, 'Size', 11);
Ole2.Set_Property(V_Font, 'Bold', TRUE );
V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg(V_Args,i.Expected);
Ole2.Invoke(V_Selection, 'TypeText', V_Args); Ole2.Destroy_Arglist(V_Args);
V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg(V_Args, wdCell);
Ole2.Add_Arg(V_Args, 1);
Ole2.Add_Arg(V_Args, wdMove);
Ole2.Invoke(V_Selection, 'MoveRight', V_Args); Ole2.Destroy_Arglist(V_Args);
END IF;
END LOOP;
V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg(V_Args, wdStory);
Ole2.Invoke(V_Selection, 'HomeKey', V_Args);
Ole2.Destroy_Arglist(V_Args);
V_Args := Ole2.Create_Arglist;
Ole2.Add_Arg(V_Args, V_File_Name);
Ole2.Invoke(V_Document, 'SaveAs', V_Args);
Ole2.Destroy_Arglist(V_Args);
Ole2.Release_Obj(V_Column);
Ole2.Release_Obj(V_Font);
Ole2.Release_Obj(V_ParagraphFormat);
Ole2.Release_Obj(V_Selection);
Ole2.Release_Obj(V_Document);
Ole2.Release_Obj(V_Documents);
Ole2.Release_Obj(V_Application);
EXCEPTION
WHEN Ole2.OLE_ERROR THEN
message('Error');
message('Error');
WHEN others THENmessage('Error');
message('Error');
END;
Full happy.....
Sorry i couldn't format the code due shortage of time
[Updated on: Wed, 22 February 2012 18:46] Report message to a moderator
|
|
|
Re: how to join tables in a cursor [message #544782 is a reply to message #544575] |
Thu, 23 February 2012 14:44 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](http://www.gravatar.com/avatar/1229663c86eb1a441385fe710cd9116e?s=64&d=mm&r=g) |
mughals_king
Messages: 392 Registered: January 2012 Location: pakistan
|
Senior Member |
|
|
For som_rajbhatti@yahoo.com
How to use picture in form developer 2000
----Example-------
create table image(img long raw);---Then call its on canvas
change block name into "main"
make two buttons one for save image in table/database & second for save image.
1st when-button-pressed change button name "Call Image"
For call image "Call Image" and type in Button Event
:CONTROL.file_path := get_file_name('D:\', NULL,
'JPEG Image (*.JPG,*.JPEG,*.JPE,*.JFIF)
|*.JPG|Bitmap Image (*.bmp)|
*.bmp|GIF Image (*.GIF)|*.GIF|TIFF Files
(*.tif)|*.tif|All Files (*.*)|*.*|', NULL);
DECLARE
image_path VARCHAR2(200);
image_extension VARCHAR2(3);
BEGIN
image_path := :CONTROL.file_path;
image_extension := SUBSTR(:CONTROL.file_path, -3);
READ_IMAGE_FILE(:CONTROL.file_path,
image_extension, 'MAIN.IMG');
(:CONTROL.file_path,
:DOCS_COMP_DOCUMENTS.file_name,
:DOCS_COMP_DOCUMENTS.file_extension);
END;
and For "Save Image" in database buttong
Commit;
Enjoy
[Updated on: Thu, 23 February 2012 14:46] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sun Sep 08 07:51:44 CDT 2024
|