Solved

Frames

Posted on 2001-06-05
9
271 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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying 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

Suggested Solutions

Title # Comments Views Activity
Add a task in Outlook from access 11 42
Modifying Conditional Format from VBA code 3 60
how to know if my Checkbox is True in VB6.0? 9 60
VB6 ListBox Question 4 49
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…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

830 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