Rotate Text with Shape inside the Worksheet with Golang via C++
Possible Usage Scenarios
You can add text inside any shape using Microsoft Excel. If you add a shape using the very old Microsoft Excel 2003, then the text will not rotate with the shape. However, if you add a shape using newer versions of Microsoft Excel, such as 2007, 2010, 2013, or 2016, the text will rotate with the shape. You can control whether the text should rotate with the shape or not using the ShapeTextAlignment.GetRotateTextWithShape() property. The default value of this property is true, which means the text will rotate with the shape. If you set it to false, the text will not rotate with the shape.
Rotate Text with Shape inside the Worksheet
The following sample code loads the sample Excel file that contains a triangle shape, and its text rotates with the shape. If you open the sample Excel file in Microsoft Excel and rotate the triangle shape, the text will also rotate with it. The code then sets the ShapeTextAlignment.GetRotateTextWithShape() property to false and saves it as the output Excel file. If you now open the output Excel file in Microsoft Excel and rotate the triangle shape, the text will not rotate with it. Please see the following screenshot showing the effect of the code on the sample Excel file for reference.