wxAutoExcel 2.5.1
Loading...
Searching...
No Matches
wxAutoExcel::wxExcelShapes Class Reference

Represents Microsoft Excel Shape object. More...

#include <wxAutoExcelShapes.h>

Inheritance diagram for wxAutoExcel::wxExcelShapes:
wxAutoExcel::wxExcelObject

Public Types

typedef wxExcelCollectionIterator< wxExcelShapes, wxExcelShape > iterator
 The iterator over the items, see wxExcelCollectionIterator.
Public Types inherited from wxAutoExcel::wxExcelObject
enum  ErrorFlags {
  Err_DoNothing = 0 , Err_LogOnInvalidDispatch = 1 , Err_AssertOnInvalidDispatch = 1 << 1 , Err_ThrowOnInvalidDispatch = 1 << 2 ,
  Err_LogOnInvalidArgument = 1 << 3 , Err_AssertOnInvalidArgument = 1 << 4 , Err_ThrowOnInvalidArgument = 1 << 5 , Err_LogOnFailedInvoke = 1 << 6 ,
  Err_AssertOnFailedInvoke = 1 << 7 , Err_ThrowOnFailedInvoke = 1 << 8 , Err_LogOnInvalidReturnType = 1 << 9 , Err_AssertOnInvalidReturnType = 1 << 10 ,
  Err_ThrowOnInvalidReturnType = 1 << 11 , Err_LogOnOtherError = 1 << 12 , Err_AssertOnOtherError = 1 << 13 , Err_ThrowOnOtherError = 1 << 14
}
 Flags affecting the behaviour of wxExcelObject and its descendants when an error occurs during accessing an Excel object property or calling its method. More...

Public Member Functions

wxExcelShape Add3DModel (const wxString &fileName, wxXlTribool linkToFile=wxDefaultXlTribool, wxXlTribool saveWithDocument=wxDefaultXlTribool, double *left=NULL, double *top=NULL, double *width=NULL, double *height=NULL)
 Creates a 3D model from an existing file.
wxExcelShape AddCallout (MsoCalloutType type, double left, double top, double width, double height)
 Creates a borderless line callout.
wxExcelShape AddChart (XlChartType type, double left, double top, double width, double height)
 Creates a chart at the specified location on the active sheet.
wxExcelShape AddChart2 (long style=-1, XlChartType *type=NULL, double *left=NULL, double *top=NULL, double *width=NULL, double *height=NULL, wxXlTribool newLayout=wxDefaultXlTribool)
 Adds a chart to the document.
wxExcelShape AddConnector (MsoConnectorType type, double beginX, double beginY, double endX, double endY)
 Creates a connector.
wxExcelShape AddCurve (const wxVector< wxPoint2DDouble > &points)
 Returns a Shape that represents a Bézier curve in a worksheet.
wxExcelShape AddFormControl (XlFormControl type, double left, double top, double width, double height)
 Creates a Microsoft Excel control.
wxExcelShape AddLabel (MsoTextOrientation orientation, double left, double top, double width, double height)
 Creates a label.
wxExcelShape AddLine (double beginX, double beginY, double endX, double endY)
 As it applies to the Shapes object, Returns a Shape that represents the new line in a worksheet.
wxExcelShape AddOLEObject (const wxString &classType=wxEmptyString, const wxString &filename=wxEmptyString, wxXlTribool link=wxDefaultXlTribool, wxXlTribool displayAsIcon=wxDefaultXlTribool, const wxString &iconFileName=wxEmptyString, long *iconIndex=NULL, const wxString &iconLabel=wxEmptyString, double *left=NULL, double *top=NULL, double *width=NULL, double *height=NULL)
 Creates an OLE object.
wxExcelShape AddPicture (const wxString &fileName, MsoTriState linkToFile, MsoTriState saveWithDocument, double left, double top, double width, double height)
 Creates a picture from an existing file.
wxExcelShape AddPicture2 (const wxString &fileName, MsoTriState linkToFile, MsoTriState saveWithDocument, double left, double top, double *width=NULL, double *height=NULL, MsoPictureCompress *compress=NULL)
 Creates a picture from an existing file.
wxExcelShape AddPolyline (const wxVector< wxPoint2DDouble > &points)
 Creates an open polyline or a closed polygon drawing.
wxExcelShape AddShape (MsoAutoShapeType type, double left, double top, double width, double height)
 Returns a Shape that represents the new AutoShape in a worksheet.
wxExcelShape AddTextbox (MsoTextOrientation orientation, double left, double top, double width, double height)
 Creates a text box.
wxExcelShape AddTextEffect (MsoPresetTextEffect presetTextEffect, const wxString &text, const wxString &fontName, double fontSize, MsoTriState fontBold, MsoTriState fontItalic, double left, double top)
 Creates a WordArt object.
wxExcelFreeformBuilder BuildFreeform (MsoEditingType editingType, double X1, double Y1)
 Builds a freeform object.
wxExcelShape Item (long index)
 Returns a single object from a collection.
void SelectAll ()
 Selects all the shapes in the specified Shapes collection.
long GetCount ()
 Returns a Long value that represents the number of objects in the collection.
wxExcelShapeRange GetRange (long index)
 Returns a ShapeRange Represents a subset of the shapes in a Shapes collection.
iterator begin ()
 Returns the iterator referring to the first item, or past the last item, which allows iterating over the items with a range-based for loop, see wxExcelCollectionIterator.
virtual wxString GetAutoExcelObjectName_ () const
 Returns "Shapes".
Public Member Functions inherited from wxAutoExcel::wxExcelObject
bool IsOk_ () const
 Returns true if the object has a valid dispatch.
wxString GetAutomationObjectName_ (bool stripUnderscores=false) const
 Returns object name as provided by IDispatch->GetTypeInfo()->GetDocumentation(MEMBERID_NIL, &name, NULL, NULL, NULL).
wxSharedPtr< wxAutomationObject > GetAutomationObject_ ()
 Returns the underlying wxAutomationObject.
 operator bool () const
 Returns true if the object has a valid dispatch and its last automation call (if any), i.e.
bool IsLastResultNull_ () const
 Returns true if MS Excel returned Null (or Empty) for the last property or method, e.g.
WXLCID GetAutomationLCID_ () const
 Returns the locale identifier used in automation calls.
bool SetAutomationLCID_ (WXLCID lcid)
 Sets the locale identifier to be used in automation calls.
bool GetPropertyAndMethodNames_ (wxArrayString &propertyNames, wxArrayString &methodNames, bool includeHidden=false)
 Returns lists of property and method names the automation interface exposes.
bool GetUnimplementedObject_ (const wxString &name, wxAutomationObject &object)
 Helper function for receiving an automation object not implemented in wxAutoExcel, see FAQ on how to use.

Additional Inherited Members

Static Public Member Functions inherited from wxAutoExcel::wxExcelObject
static unsigned GetErrorMode_ ()
 Sets the error mode to the combination of wxExcelObject::ErrorFlags.
static void SetErrorMode_ (unsigned mode)
 Sets the error mode as the combination of wxExcelObject::ErrorFlags.
static bool GetUnimplementedCollectionItem_ (wxAutomationObject &collection, const long index, wxAutomationObject &item, bool asProperty)
 Helper function for obtaining an item from MS Excel collection not implemented in wxAutoExcel, see FAQ on how to use.

Detailed Description

Represents Microsoft Excel Shape object.

Member Typedef Documentation

◆ iterator

Member Function Documentation

◆ Add3DModel()

wxExcelShape wxAutoExcel::wxExcelShapes::Add3DModel ( const wxString & fileName,
wxXlTribool linkToFile = wxDefaultXlTribool,
wxXlTribool saveWithDocument = wxDefaultXlTribool,
double * left = NULL,
double * top = NULL,
double * width = NULL,
double * height = NULL )

Creates a 3D model from an existing file.

Excel VBA documentation for Shapes.Add3DModel

◆ AddCallout()

wxExcelShape wxAutoExcel::wxExcelShapes::AddCallout ( MsoCalloutType type,
double left,
double top,
double width,
double height )

Creates a borderless line callout.

Returns a Shape that represents the new callout.

MSDN documentation for Shapes.AddCallout.

◆ AddChart()

wxExcelShape wxAutoExcel::wxExcelShapes::AddChart ( XlChartType type,
double left,
double top,
double width,
double height )

Creates a chart at the specified location on the active sheet.

For Excel 2013 and newer it is recommended to use AddChart2 instead.

MSDN documentation for Shapes.AddChart.

◆ AddChart2()

wxExcelShape wxAutoExcel::wxExcelShapes::AddChart2 ( long style = -1,
XlChartType * type = NULL,
double * left = NULL,
double * top = NULL,
double * width = NULL,
double * height = NULL,
wxXlTribool newLayout = wxDefaultXlTribool )

Adds a chart to the document.

Returns a Shape object that represents a chart and adds it to the specified collection. Since Excel 2013.

MSDN documentation for Shapes.AddChart2.

◆ AddConnector()

wxExcelShape wxAutoExcel::wxExcelShapes::AddConnector ( MsoConnectorType type,
double beginX,
double beginY,
double endX,
double endY )

Creates a connector.

Returns a Shape that represents the new connector. When a connector is added, it's not connected to anything. Use the BeginConnect and EndConnect methods to attach the beginning and end of a connector to other shapes in the document.

MSDN documentation for Shapes.AddConnector.

◆ AddCurve()

wxExcelShape wxAutoExcel::wxExcelShapes::AddCurve ( const wxVector< wxPoint2DDouble > & points)

Returns a Shape that represents a Bézier curve in a worksheet.

MSDN documentation for Shapes.AddCurve.

◆ AddFormControl()

wxExcelShape wxAutoExcel::wxExcelShapes::AddFormControl ( XlFormControl type,
double left,
double top,
double width,
double height )

Creates a Microsoft Excel control.

Returns a Shape that represents the new control.

MSDN documentation for Shapes.AddFormControl.

◆ AddLabel()

wxExcelShape wxAutoExcel::wxExcelShapes::AddLabel ( MsoTextOrientation orientation,
double left,
double top,
double width,
double height )

Creates a label.

Returns a Shape that represents the new label.

MSDN documentation for Shapes.AddLabel.

◆ AddLine()

wxExcelShape wxAutoExcel::wxExcelShapes::AddLine ( double beginX,
double beginY,
double endX,
double endY )

As it applies to the Shapes object, Returns a Shape that represents the new line in a worksheet.

MSDN documentation for Shapes.AddLine.

◆ AddOLEObject()

wxExcelShape wxAutoExcel::wxExcelShapes::AddOLEObject ( const wxString & classType = wxEmptyString,
const wxString & filename = wxEmptyString,
wxXlTribool link = wxDefaultXlTribool,
wxXlTribool displayAsIcon = wxDefaultXlTribool,
const wxString & iconFileName = wxEmptyString,
long * iconIndex = NULL,
const wxString & iconLabel = wxEmptyString,
double * left = NULL,
double * top = NULL,
double * width = NULL,
double * height = NULL )

Creates an OLE object.

Returns a Shape that represents the new OLE object.

MSDN documentation for Shapes.AddOLEObject.

◆ AddPicture()

wxExcelShape wxAutoExcel::wxExcelShapes::AddPicture ( const wxString & fileName,
MsoTriState linkToFile,
MsoTriState saveWithDocument,
double left,
double top,
double width,
double height )

Creates a picture from an existing file.

Returns a Shape that represents the new picture.

MSDN documentation for Shapes.AddPicture.

◆ AddPicture2()

wxExcelShape wxAutoExcel::wxExcelShapes::AddPicture2 ( const wxString & fileName,
MsoTriState linkToFile,
MsoTriState saveWithDocument,
double left,
double top,
double * width = NULL,
double * height = NULL,
MsoPictureCompress * compress = NULL )

Creates a picture from an existing file.

Returns a Shape that represents the new picture.

MSDN documentation for Shapes.AddPicture2.

◆ AddPolyline()

wxExcelShape wxAutoExcel::wxExcelShapes::AddPolyline ( const wxVector< wxPoint2DDouble > & points)

Creates an open polyline or a closed polygon drawing.

Returns a Shape that represents the new polyline or polygon.

MSDN documentation for Shapes.AddPolyline.

◆ AddShape()

wxExcelShape wxAutoExcel::wxExcelShapes::AddShape ( MsoAutoShapeType type,
double left,
double top,
double width,
double height )

Returns a Shape that represents the new AutoShape in a worksheet.

MSDN documentation for Shapes.AddShape.

◆ AddTextbox()

wxExcelShape wxAutoExcel::wxExcelShapes::AddTextbox ( MsoTextOrientation orientation,
double left,
double top,
double width,
double height )

Creates a text box.

Returns a Shape that represents the new text box.

MSDN documentation for Shapes.AddTextbox.

◆ AddTextEffect()

wxExcelShape wxAutoExcel::wxExcelShapes::AddTextEffect ( MsoPresetTextEffect presetTextEffect,
const wxString & text,
const wxString & fontName,
double fontSize,
MsoTriState fontBold,
MsoTriState fontItalic,
double left,
double top )

Creates a WordArt object.

Returns a Shape that represents the new WordArt object.

MSDN documentation for Shapes.AddTextEffect.

◆ BuildFreeform()

wxExcelFreeformBuilder wxAutoExcel::wxExcelShapes::BuildFreeform ( MsoEditingType editingType,
double X1,
double Y1 )

Builds a freeform object.

Returns a FreeformBuilder Represents the freeform as it is being built. Use the AddNodes method to add segments to the freeform. After you have added at least one segment to the freeform, you can use the ConvertToShape method to convert the FreeformBuilder object into a Shape object that has the geometric description you’ve defined in the FreeformBuilder object.

MSDN documentation for Shapes.BuildFreeform.

◆ Item()

wxExcelShape wxAutoExcel::wxExcelShapes::Item ( long index)

Returns a single object from a collection.

MSDN documentation for Shapes.Item.

◆ SelectAll()

void wxAutoExcel::wxExcelShapes::SelectAll ( )

Selects all the shapes in the specified Shapes collection.

MSDN documentation for Shapes.SelectAll.

◆ GetCount()

long wxAutoExcel::wxExcelShapes::GetCount ( )

Returns a Long value that represents the number of objects in the collection.

MSDN documentation for Shapes.Count.

◆ GetRange()

wxExcelShapeRange wxAutoExcel::wxExcelShapes::GetRange ( long index)

Returns a ShapeRange Represents a subset of the shapes in a Shapes collection.

MSDN documentation for Shapes.Range.

◆ begin()

iterator wxAutoExcel::wxExcelShapes::begin ( )
inline

Returns the iterator referring to the first item, or past the last item, which allows iterating over the items with a range-based for loop, see wxExcelCollectionIterator.

◆ GetAutoExcelObjectName_()

virtual wxString wxAutoExcel::wxExcelShapes::GetAutoExcelObjectName_ ( ) const
inlinevirtual

Returns "Shapes".

Reimplemented from wxAutoExcel::wxExcelObject.