[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How does a document inherit the content of an embedded Object (OLE)

Posted on 2004-11-08
17
Medium Priority
?
290 Views
Last Modified: 2013-12-18
I have got a richtext field, in which i placed an embedded object. (excel-sheet, changes will be saved in the document). Now i have to create a new document, which take some contents of the marked document. That's no problem, but i don't get the content of the "excel-sheet". I only get the empty sheet. Is there any way to solve my problem?
0
Comment
Question by:bkib
  • 6
  • 5
  • 3
  • +2
17 Comments
 
LVL 19

Expert Comment

by:RanjeetRain
ID: 12522415
I assume you are talking about a client application.

You can write an agent to do so. Put a field containing the Universal ID in the original document from which you want to inherit. In the agent, using the universal ID of the parent document, get the document and the embedded object in it, save it to a temporary file and attach it to the current document.

Hope I was clear.
0
 
LVL 14

Expert Comment

by:p_partha
ID: 12523789
You are embedding the object ina  richtext field right, do you have the same richtext field name in the response document(or the inherited document)?

Partha
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 12524059
OLE object doesn't get inherited !

You have to copy the ole object..get the handle of the ole object in the selected document and embed it into the new doc's rich text.. this can be done during queryopen of the form..

~Hemanth
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 19

Expert Comment

by:RanjeetRain
ID: 12525990
Hemantha,

You and I are saying essentially the same thing, right ;-)
0
 
LVL 1

Expert Comment

by:Alexey_Zubkov
ID: 12532285
Most likely, when you are trying to get sheet content, you have used non-active Excel OLE object.

Try to add code:  call Sheet.Activate or Sheet.Active = true. I dont remember exact code, but the problem is hereabout.

Better, post here your LS code where you open excel-sheet.
0
 

Author Comment

by:bkib
ID: 12542744
I forgot an important detail. the object is embedded in the form, not in document, so everybody works with the same formatted sheet.  i tried your tips but i don't get the object neither the objectarray:
Set db=session.currentdatabase
Set col=db.unprocesseddocuments
Set doc=col.getfirstdocument
Set item=doc.getfirstitem("Name")
notesEmbeddedObjectArray = item.EmbeddedObjects 'this doesn't works
If item.Type = RICHTEXT Then
 Set object= item.getembeddedobject("Microsoft Excel-Arbeitsblatt") ' object wasn't set
End If
What' wrong?
0
 
LVL 1

Expert Comment

by:Alexey_Zubkov
ID: 12543125
Do you open and save excel document after embedding it into form?

Try open it and save in your form in designer. Only after that embed object will be valid.
0
 

Author Comment

by:bkib
ID: 12543252
Hi Alexey
i did, but in LS the object is not set.
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 12545192
Since you said it is in the form,.. you have to access the embeddedobject using NoteDocument NOT richtext item.

0
 
LVL 24

Accepted Solution

by:
HemanthaKumar earned 1050 total points
ID: 12545215
And if it is on the form.. then what is that you are not inheriting... the changes made in a document ? Well you don't expect to.. as form will override the object...If it is on richtext item (and not on form) then you could use the script to copy the object
0
 
LVL 1

Assisted Solution

by:Alexey_Zubkov
Alexey_Zubkov earned 450 total points
ID: 12546316
Actually, there is an error in LS script.
Instead of
Set item=doc.getfirstitem("Name")
notesEmbeddedObjectArray = item.EmbeddedObjects 'this doesn't works
If item.Type = RICHTEXT Then
 Set object= item.getembeddedobject("Microsoft Excel-Arbeitsblatt") ' object wasn't set
End If

try
Dim eo as NotesEmbeddedObject
Set eo = doc.EmbeddedObjects(0)
Set object = eo.object

So, you have in variable "object" Excel OLE object, that you needed.
Then you may require call object.Activate
and then you can use this OLE object as you want.

Sorry, I didnt find one of my old databases where I make almost the same task with Excel object as yours, so I write code here from memory.
0
 

Author Comment

by:bkib
ID: 12595012
ok, I understand hemanthaKumar that i have to do it in documents. I made an action, which embed the excel sheet as object in a richtextfield. With the tips from Alexey it works. I can see the items in Debugger with the object and so on. But I don't get the object in uidocument. Users won't see them and can't edit them.
????
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 12595689
you mean you can't see the embedded object ? Is the richtext field visible and is available on the document ? and did u save the doc after embedding ?
0
 

Author Comment

by:bkib
ID: 12596560
Yes, the richtextfield is visible, available, I saved the document, reloaded the uidocument. I've closed it, nevertheless I couldn't see the object after opening. How do I copy or embed the handle of an OLE object?
0
 

Author Comment

by:bkib
ID: 12602864
I've got it. I didn't use the right classes and methods. With Notesuidocument and "createobject" it works. Now my, let's hope, last question: In the document I let the object shown as "symbol", then when I open the object it is opened with all Excel functions. otherwise I don't have the menuebar and so on. Is there any possibility to give this property with script, so that the user don't have to do so?
0
 
LVL 24

Assisted Solution

by:HemanthaKumar
HemanthaKumar earned 1050 total points
ID: 12608700
You can activate the object using Activate method of embeddedobject.. and doverb "Open"... Look into help for this functions

Or the form launch property can be set to launch the ole object inplace.
0
 

Author Comment

by:bkib
ID: 12613093
Now it works well. Thanks to HemanthaKumar and Alexey Zubkov. I will split the points.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…

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