?
Solved

OLEContainer (Word) keep the menu(s) in the container!

Posted on 2003-03-16
6
Medium Priority
?
1,130 Views
Last Modified: 2010-04-04
Delphi6 Pro
MS Word 2002
Windows XP Home (Urgh!)

Hi Guys / Girls,
I have a small query but one that is indeed bugging me.
I have a form with 2 panels (1 align left) (2 align client) with a splitter in-between. On the left hand panel I have a list of word documents and when the user selects a document from the list, it opens in the OLE container on the Panel2.

ie

OLEContainer1.CreateObjectFromFile('c:\guide uk.doc',False);

All very straightforward, but!. When the Word menu bar is activated for editing, the menu bars are created along the top of the form and NOT within the container. This is a problem as it throws all the screen design out.

How can I keep all associated word menus etc within the bounds of the olecontainer?

Cheers for any assistance

Stu
0
Comment
Question by:08718712060
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 

Author Comment

by:08718712060
ID: 8148200
SORRY FOR THE LOW POINTS (RUNNING SHORT)
0
 
LVL 9

Accepted Solution

by:
mocarts earned 500 total points
ID: 8153127
at the moment I found a solution how to disable menu merging (and main form overlaying by olecontainer)..
but there is some problem with main menu on contained form (not really a problem, as it's normally when form have one main menu, but we want another one)

...
ole1: TOleContainer;
...
procedure TForm1.Button1Click(Sender: TObject);
begin
  ole1.Parent.Visible := False;
  ole1.Parent.Parent := nil;
  try
  ole1.CreateObjectFromFile('D:\my.doc', false);
  finally
    ole1.Parent.Parent := Panel2;
    ole1.Parent.VIsible := True;
  end;
end;

procedure TForm1.FormCreate(Sender: TObject);
var
 f: TForm;
begin
  f:= TForm.Create(Self);
  with f do begin
    BorderStyle := bsNone;
    BorderIcons := [];
    Align := alClient;
  end;
  Ole1 := TOleContainer.Create(f);
  Ole1.Parent := f;
  Ole1.Align := alClient;
end;

wbr, mo.
0
 

Author Comment

by:08718712060
ID: 8153434
Cheers mocarts,
Life saving isnt close enough to the mark!. cheers m8
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:08718712060
ID: 8165849
mocarts,
Just a quicky if you are still getting alerts from this post.

How can I open the word document (read only) ie no menus?
0
 
LVL 9

Expert Comment

by:mocarts
ID: 8165883
do you mean readonly when activated? (at the moment I don't know how to manage it, but you can look in ObjectVerbs property of container - maybe there is something useful?)
or you simply want to browse through document?
in such case set AutoActivate property to aaManual and when you need edit the document call olecontainer.DoVerb(ovShow) method.

wbr, mo.
0
 

Author Comment

by:08718712060
ID: 8172693
Cheers mocarts, I think I may need to look at embedding TWordApplication in a form / panel as opposed to OLEContainer.

Ill open a new post I think ,

Cheers for your help

S
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month10 days, 4 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question