View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
stefan onken stefan onken is offline
external usenet poster
 
Posts: 33
Default Please help with OLE object and text box content!

hi Jolene,
have a look at the AddTextbox-method in VBA-help, there`s an example:

Sub CreateTextbox()
Set myDocument = Worksheets(1)
myDocument.Shapes.AddTextbox(msoTextOrientationHor izontal, _
100, 100, 200, 50) _
.TextFrame.Characters.Text = "Test Box"
End Sub

you can create an embedded word-doc with
ActiveSheet.OLEObjects.Add(ClassType:="Word.Docume nt")
but i don`t know how to put text in there.

i could give you a code that creates a word-doc with the text
and then embeds this word-doc in the sheet, if necessary.


stefan

On 7 Mai, 10:09, Jolene wrote:
Hi

How do I create a new embedded word doc with text in excel (i.e. it should
look like a text box in which I have written something).

Otherwise, how do you create a text box with text in VB code?

Thanks!