Solved

Frames

Posted on 2001-06-05
9
258 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
Comment Utility
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
Comment Utility
Interesting... i have some on that matter.
0
 
LVL 9

Expert Comment

by:Valliappan AN
Comment Utility
ping...
0
 
LVL 8

Expert Comment

by:glass_cookie
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 16

Expert Comment

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

Expert Comment

by:rspahitz
Comment Utility
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
Comment Utility
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
Comment Utility
Fine to me.
0
 
LVL 1

Expert Comment

by:Computer101
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

743 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

8 Experts available now in Live!

Get 1:1 Help Now