Link to home
Start Free TrialLog in
Avatar of jiaf
jiaf

asked on

Embedding MS Word

Hi...

I am embedding MS Word into a Delphi Application. The problem that i have is when i resize the form  when Word is not activated... The OLE component does not change its size.

I want to be able to change the size of the Ole Container, and have Word change its size automatically.

Does somebody know how?

José Araujo
ASKER CERTIFIED SOLUTION
Avatar of mfhobbs
mfhobbs

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jiaf
jiaf

ASKER

The problem is that if i activate the OLE object (using ole.DoVerb(ovShow)) then the window if resized again,because the OLE object add a menu (i don't have a regular menu), and then it enters in a loop... I solved that with a flag variable... but i don't like it that way.

I know Outlook XP uses Word for writing emails, and it does not seem to have those problem. I am wondering where i can find information about how outlook interacts with word.
It's an arcane art.  I think Microsoft know all the tricks but as far as I know, they haven't released the details.  Perhaps Word is now like an Active-X control in XP?! Or now a base component... TWordEdit :)

In our app we have the ability to have 2 word windows open on the same form (upper and lower panels).  It works but, as you know, its not going to be as clean as it could be.

Good luck,
-Mat

Try this

The resize wvent is for the panel or form that word is embedded into.

procedure TForm.PanelResize(Sender: TObject);
begin
  OleContainer1.Align:=alClient;
  OleContainer1.Refresh;
end;


JD

jiaf:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.