Instead of an Ordinary TextBox, I want an MS Word Box

FourPhDs

New Member
Joined
Sep 4, 2008
Messages
3
In addition to the standard controls one puts on userform, I have put on the controls for the WebBrowser and the Excel Spreadsheet. These work fine, but now I want to put on a control which is a small MS Word window instead of using a regular text box. My application creates a complex Word document section by section, and for each section it prompts the user with the type of material to enter at each section. I want the full power of word but in a small Excel form control. Any ideas?
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
I created a button on my form with
Private Sub CommandButton3_Click()
Dim myxxx As String

myxxx = "File:\" + UserForm1.TextBox7.Value + "myfondestdesire.doc"
UserForm3.WebBrowser1.Navigate myxxx

End Sub

The above puts MS Word in a web browser and this seems to work. I am trying to get webbrowser1.toolbar set to the values so that it comes up with both the Standard and Formating toolbars, but I can not figure out the values to do this.

Using the "Record Macro" feature is usually a great idea, but where does the "WordBox" come from for me to place it on the form. If I know the name of the WordBox control, I would just add it directly to my form.

:LOL:
 
Upvote 0
Record a macro worked for me, perhaps i am misunderstanding, I am slow :oops:

Code:
Sub Macro1()

' Macro1 Macro
' Macro recorded 9/4/2008 by TheDude

    ActiveSheet.OLEObjects.Add(ClassType:="Word.Document.8", Link:=False, _
        DisplayAsIcon:=False).Activate

End Sub

-Dude
 
Upvote 0
FourPhDs

I just don't think this is going to be possible, and if it is I'm sure it's going be a lot more complicated than the code you posted.

What is it you actually want to do?

What does this mean?
My application creates a complex Word document section by section, and for each section it prompts the user with the type of material to enter at each section
And what 'full power' Word functionality are you trying to harness?:)
 
Upvote 0
I am on a team that has to write over 100 documents which have the structure of a formal specification. The traditional way of doing this is to create them in MS Word a document at a time (perhaps using a template for some of the boilerplate stuff).

My Excel program is essentially using Excel as a database. The spreadsheets contains structure material which defines the contents of a particular type of document, and also contains prompting information, and eventually the documents themselves.

When you currently execute the Excel program, a VBA form initially comes up (the spreadsheets are behind the scene and are no concern to the end user). Using controls on the VBA form you can choose the type of document you wish to create. There are two large text boxes on the screen. The top text box tells you the type of iunformation the system expects you to type into the lower box. You also select which section of the document you are working with. Then you type in the material at section at a time. When you are finished, you can click a button and see the entire document in the lower textbox, and by clicking another button you can print it out as a Word document. this is the way the program works now.

But using an ordinary text box limits me. I can not easily specify different font sizes, styles, insert diagrams, figures, automatically create TOC.
If I had a MS Word text box, then I could do everything directly in Word. I can sort of get that by using a WebBrowser box. More later. I have tlo go to a meeting.
 
Upvote 0
Is there a reason why you cannot just programatically open up word & work directly in it? You could use VBA to create toolbar buttons in the word instance which could then do the additional tasks afterwards.
 
Upvote 0

Forum statistics

Threads
1,215,043
Messages
6,122,812
Members
449,095
Latest member
m_smith_solihull

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top