Solved

Frames

Posted on 2001-06-05
9
277 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
[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
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
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…

738 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