HELP : MS Word Objects in Delphi 1.0 OLE Container
Hi all.
I've been asked to write an applications that would store Word files as OLE
objects. I've managed to write code that would stream this to and from an OLE
field in a Paradox table. So far so good.
My chief problem is displaying whole Word documents in the container.
Insertion is done through InsertOLEObjectDlg. I've written code that would
reset the Scroll Box's scrollbars to the size of the Word Doc. But for the
LIFE of me I have no clue as to how to display text beyond the first page of a
Word file!?! Even if the Vertical Scroll Bars are extended, nothing is
displayed beyond the first page of the Word object. Bellow is the code I use
to do this.
////////////////////
if InsertOLEObjectDlg(Main, 0, Info) then
begin
CreateOleObject (Info);
ReleaseOLEInitInfo(Info);
end;
end;
procedure TMain.CreateOleObject (PInfo : Pointer);
var
Ctrl : TOleContainer;
X,Y : Integer;
begin
Ctrl := TOleContainer.Create (Self);
X := 10;
Y := 10;
if ScrollBox1.ControlCount > 0 then
begin
X := ScrollBox1.Controls [ScrollBox1.ControlCount - 1].Left;
Y := ScrollBox1.Controls [ScrollBox1.ControlCount - 1].Top +
ScrollBox1.Controls [ScrollBox1.ControlCount - 1].Height + 20;
end;
Ctrl.SetBounds (0, 0, 230, 150);
Ctrl.visible := True;
Ctrl.enabled := True;
Ctrl.AutoSize := True;
Ctrl.OnStatusLineEvent := StatusLineEvent;
Ctrl.PInitInfo := PInfo;
Ctrl.Parent := ScrollBox1;
ActiveControl := Ctrl;
//////////////////
I'm a beginner to the art of OLE and using Delphi. Is this possible throught
Word.Basic? If so how? Or is it a WINAPI thing?
I've scanned this newsgroup for the past few days but nothing related came up.
So if anybody has come across this or has an idea how to go about it I would
be iternally gratefull.
Many thanks in advance.