Age: 40 Joined: 01 Feb 2008 Posts: 387 Location: Воронеж
Posted: Wed Jun 26, 2013 9:35 pm Post subject: Картинка из Word
Добрый день, пока постановка следующая, в документе word лежит картинка. Нужно ее из этого документа забрать... _________________ Hормальные люди делают вещи намного более безумные чем всё, что делают сумасшедшие (c) С.Лем
Age: 170 Joined: 04 Oct 2007 Posts: 1218 Location: Санкт-Петербург
Posted: Wed Jun 26, 2013 10:33 pm Post subject:
Привет!
Нашел только perl пример, по крайней мере есть направление, куда копать.
You need InlineShapes() and Shapes for this:
Quote:
InlineShape Object
Represents an object in the text layer of a document. An inline shape can only be a picture, an OLE object, or an ActiveX control. InlineShape objects are treated like characters and are positioned as characters within a line of text. The InlineShape object is a member of the InlineShapes collection. The InlineShapes collection contains all the shapes in a document, range, or selection.
Using the InlineShape Object
Use InlineShapes(index), where index is the index number, to return a single InlineShape object. Inline shapes don't have names. The following example activates the first inline shape in the active document.
ActiveDocument.InlineShapes(1).Activate
Remarks
Shape objects are anchored to a range of text but are free-floating and can be positioned anywhere on the page. You can use the ConvertToInlineShape method and the ConvertToShape method to convert shapes from one type to the other. You can convert only pictures, OLE objects, and ActiveX controls to inline shapes. Use the Type property to return the type of inline shape: picture, linked picture, embedded OLE object, linked OLE object, or ActiveX control.
When you open a document created in an earlier version of Word, pictures are converted to inline shapes.
Еще зависит от того, как она лежит: как картинка в тексте (InlineShapes), или как картинка сама по себе (Shapes).
С первым вариантом работал, правда была противоположная задача - вставить картинку В итоге делал макросом. Наверное как простой вариант - можно макросом ее выделить и скопировать в буфер.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.