Solved

Frames

Posted on 2001-06-05
9
263 Views
Last Modified: 2010-05-02
I've a VB Problem here.....there are 2 frames in a single form. the first frame contains few command buttons. if I click on the one of the command buttons, it should open a word application within the second frame. a frame can contain controls, can it contain a window within itself. the problem is that I'm able to open the word application as a seperate window not within frame 2. Please help me with this.


Harish
0
Comment
Question by:harishsc
9 Comments
 
LVL 18

Accepted Solution

by:
bobbit31 earned 50 total points
ID: 6157983
you can use the ole container control.

put an ole container on the form and select microsoft word document for the class.  you can either set the sourcedoc property at run-time or design-time.  set the ole1.action property to 7 to activate the document (word menus will appear so you can edit)

one problem you might run into is that you have to implement your own scrollbars... This might help you on your way to doing that:

1. Start Visual Basic; Form1 is created by default.

2. Add an OLE container control to Form1 (Ole1 is the default name for the control).

3. The insert object dialog box should appear after you draw the OLE container control on the form. Choose Create from the File option, and choose an existing Word .DOC file that is more than a page in length. The "Link" and "Display As Icon" check boxes should not be selected. Choose the OK button when you are done; the document should now be embedded in the OLE container control.

4. Add a VScrollBar button to Form1 (SpinButton1 is the default name of the control).

5. Place the following code in the UpDown1_DownClick event:

Private Sub UpDown1_DownClick()
If OLE1.AppIsRunning Then
OLE1.Object.Application.WordBasic.VLine -1
         Else
         OLE1.Action = 7        'Activate
End If
End Sub

6. Place the following code in the UpDown1_UpClick event.

Private Sub UpDown1_UpClick()
If OLE1.AppIsRunning Then
OLE1.Object.Application.WordBasic.VLine 1
     Else
         OLE1.Action = 7           'Activate
End If
End Sub

7. Save the project.

8. Run the application.

9. Double-click the OLE control to activate the Word .DOC object for visual editing.

10.Press the VScrollBar button to scroll up and down the document.

good luck!

0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6158460
Interesting... i have some on that matter.
0
 
LVL 9

Expert Comment

by:Valliappan AN
ID: 6158472
ping...
0
 
LVL 8

Expert Comment

by:glass_cookie
ID: 6158543
Hi!

Here's another alternative:

Download...
http://www.vb-helper.com/Howto/startin.zip
Description: Start a program inside another (3K)

Just change the picture control to that of a frame control and see how it works : )  It's fun : ) The program would be 'trapped' in the control.

Remember also that you'll need to have the path of Microsoft Word.

That's it!

glass cookie : )
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6160711
My code is the same as glass cookie posted, sorry.
But vb-helper is down.
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 6165810
If you change the second frame to a picture control, you get more flexibility in this regard.  It's still a container, you could add your own rectangle around it with an overlapping label, and you can add pictures, etc.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7132930
Hi harishsc,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will suggest to:

    Split points between: bobbit31 and glass_cookie

harishsc, if you think your question was not answered at all or if you need help, you can simply post a new comment here.  Community Support moderators will follow up.

EXPERTS: If you disagree with my recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7132966
Fine to me.
0
 
LVL 1

Expert Comment

by:Computer101
ID: 7167905
Points reduced for split and comment accepted as answer.  The other expert can look for their question in this topic area

Computter101
E-E Moderator
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

895 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now