Embedded documents: full display of pages/slides
William Cook -- william@luma.com Saturday, February 03, 1996 I have what seems like a very simple and standard requirement, but I can't find any way to do it: I want to get ALL the visual presentation out of an embedded OLE object. This means I want to get all the pages of a Word document, and all the slides of an embedded PowerPoint presentation. This way I can put up next/previous buttons that allow me to see all of the embedded document. This seems like a really obvious application to me, but it doesn't seem to be supported. I'd like to get the pages as (enhanced) metafile handles, just like the current Draw works. Here is what I have tried: Calling GetExtent and Draw in a COleClientItem only seems to give me the size/image of the first page/slide of an embedded object. I figured that we could use OLE Automation to drive the Word/PowerPoint app to flip pages while the object is embedded. But this does not seem to be a supported behavior. Nowhere in any documentation or book have I found out how to get an IDispatch (or COleDispatchDriver from a TypeLib) out of a COleClientItem. VisualBasic seems to be able to do this kind of thing with its OLE1.Object construct. How do you do it in VisualC++? And even if you can do it, will it allow you to flip slides in a PowerPoint presentation that is not activated? This didn't seem to be going anywhere, soo.. I've tried making a CDataObject and then requesting that the object print it self out to a metafile... I haven't tried this as much, but am having no luck initially. HELP! Any pointers would be greatly appreciated. -william cook william@luma.com
Mike Blaszczak -- mikeblas@interserv.com Saturday, February 03, 1996 On Sat, 03 Feb 1996, William Cookwrote: >I have what seems like a very simple and standard requirement, but I can't >find any way to do it: >I want to get ALL the visual presentation out of an embedded OLE object. >This means I want to get all the pages of a Word document, and all the >slides of an embedded PowerPoint presentation. OLE doesn't support objects that span pages. I'm not sure if I've lately heard an estimate from the OLE guys about when it finally will. Adding this support involves lots of non-trivial issues. I'm not sure about some of the specifics of your application, but maybe you'd be better off trying to embed your object, control it with automation, and then get the pages or slides or blocks or ... step by step. .B ekiM -- TCHAR szDisc[] = _T("These words are my own; I do not speak for Microsoft.");
William Cook -- william@luma.com Sunday, February 04, 1996 [Mini-digest: 2 responses] ekiM- Thanks for the fast response. Let me try and clarify: At 09:38 PM 2/3/96 -0800, ".B ekiM" wrote: >On Sat, 03 Feb 1996, William Cookwrote: > >>I want to get ALL the visual presentation out of an embedded OLE object. >>This means I want to get all the pages of a Word document, and all the >>slides of an embedded PowerPoint presentation. > >OLE doesn't support objects that span pages. I'm not sure if I've lately >heard an estimate from the OLE guys about when it finally will. Adding this >support involves lots of non-trivial issues. > >I'm not sure about some of the specifics of your application, but maybe you'd >be better off trying to embed your object, control it with automation, and >then get the pages or slides or blocks or ... step by step. Actually, I am trying to "embed the object, control it with automation, and then get the pages step by step". But I can't find anything anywhere that mentions embedding and automation in the same paragraph. Any pointers? (As far as multiple pages go, if I can get the information out of the embedded object, then I can deal with breaking it up into pages). -william -----From: Ludek Slegr Hi, > I want to get ALL the visual presentation out of an embedded OLE object. > This means I want to get all the pages of a Word document, and all the > slides of an embedded PowerPoint presentation. I guess, that the solution you suggested is the only one i.e. to control the OLE object using OLE Automation. > Nowhere in any documentation or book have I found out > how to get an IDispatch (or COleDispatchDriver from a TypeLib) out of a > COleClientItem. There is a sample on the MSDL CD. It includes usage of "m_lpObject" data member of the COleClientItem class. Try to look for "COleClientItem IDispatch m_lpObject". Regards, Ludek
Jim Lavin -- ooptech@Onramp.NET Thursday, February 08, 1996 At 06:44 PM 2/4/96 -0800, you wrote: >>I'm not sure about some of the specifics of your application, but maybe you'd >>be better off trying to embed your object, control it with automation, and >>then get the pages or slides or blocks or ... step by step. > >Actually, I am trying to "embed the object, control it with automation, and then >get the pages step by step". But I can't find anything anywhere that mentions >embedding and automation in the same paragraph. Any pointers? > >(As far as multiple pages go, if I can get the information out of the embedded >object, then I can deal with breaking it up into pages). > We've ran into some problems with trying to get at the WORD.BASIC IDispatch under Word 6.0. It seems that it doesn't really like you playing with the embedded Word.Document object under Automation when it is active. We had to go the long way, by deactivating the object and requesting an IDispatch to Word.Basic and then performing the automation. We wanted to embed the document in a filing cabinet and then have it print on demand. I don't think you would have any trouble with Word 7.0 since it includes the new IPrint interface mentioned in the preliminary DocObject specifications. You should be able to request the interface and manipulate it a lot easier than with the older version. Has anybody else had any luck with mainpulating Word and Excel through automation while they are actively embedded? Jim Lavin OOP Technologies http://emporium.turnpike.net/~jlavin http://rampages.onramp.net/~ooptech I've seen programmers who couldn't be passed by reference or by value!
| Вернуться в корень Архива |