Please help with OLE object and text box content!
Stefan,
Now if you wanted to allow the user to save the embedded OLE Object, olewd,
to whatever filename they wanted how would you do that? I can't find a Save
or SaveAs method on OLEObjects
"stefan onken" wrote:
hi Jolene,
Sub CreateWordOleObj()
'Active workbook must have been saved, otherwise
'change wdFilename to an existing path
wdFilename = ActiveWorkbook.Path & "\test.doc"
If Dir(wdFilename) < "" Then Kill wdFilename
Set wd = CreateObject("Word.Application")
wd.documents.Add
wd.activedocument.Paragraphs(1).Range.Text = "hello"
wd.activedocument.SaveAs wdFilename
wd.Quit
'ActiveSheet.OLEObjects(1).Delete
Set olewd = ActiveSheet.OLEObjects.Add _
(Filename:=wdFilename, _
Link:=False, _
DisplayAsIcon:=False)
olewd.Top = Range("A1").Top
olewd.Left = Range("A1").Left
olewd.Width = Range("A1").Width
End Sub
stefan
On 7 Mai, 13:30, Jolene wrote:
Thanks Stefan! Would you please give me the code for the word doc as well? It
would really help a lot!
|