I need to copy autoshapes objects from an embedded Excel spreadsheet object to an embedded Word Picture object. I know the autoshapes are compatible with the destination object because I can manually copy and paste them and they are accepted. I just can’t find an example syntax for creating or pasting objects into the word.picture.8 object.
Dim estdoc As NotesDocument
Dim destdoc As NotesDocument
Dim rtexcel As NotesRichTextItem
Dim rtwordpic As NotesRichTextItem
Dim srcobject As NotesEmbeddedObject
Dim destobject As NotesEmbeddedObject
Dim destpic As NotesEmbeddedObject
Dim var1 As Variant
Dim var2 As Variant
Dim spreadsheet As String
'Open the source object
spreadsheet = “spreadsheet1”
Set rtexcel = estdoc.GetFirstItem( spreadsheet )
Set srcobject = rtexcel.EmbeddedObjects(0)
If (srcobject Is Nothing) Then
'not found
Else
Set srchandle = srcobject.Activate(True)
numsheets = srchandle.worksheets.count
srchandle.application.workbooks(1).worksheets(1).activate
End If
'just testing, I’m able to grab two autoshapes objects from the source spreadsheet as follows:
Set var1 = srchandle.Application.ActiveSheet.shapes(1)
Set var2 = srchandle.Application.ActiveSheet.shapes(2)
'Open the destination object
Set destdoc = New NotesDocument( db )
Set rtwordpic = New NotesRichTextItem( destdoc, “shape” )
Set destpic = rtwordpic.embedobject(EMBED_OBJECT,“word.picture.8”,“”,“autoshape canvas”)
Set destobject = rtwordpic.EmbeddedObjects(0)
If (destobject Is Nothing) Then
'not found
Else
Set desthandle = destobject.Activate(True)
'What command would go here to insert one or more autoshapes into destpic or destobject?
desthandle.save
End If