|
发表于 2020-3-12 18:15:02
|
显示全部楼层
刚说完,倒找到一个,参考吧:
import java.awt.event.ActionEvent;
import application.Application;
import application.EAbstractAction;
import application.workbooks.Workbook;
import application.workbooks.workbook.documents.Document;
public class CustomObj
{
private Shapes shapes;
public CustomObj()
{
Workbooks workbooks = Application.getWorkbooks();
if (workbooks != null)
{
Workbook workbook = workbooks.getActiveWorkbook();
if (workbook != null)
{
shapes = workbook.getActiveShapes();
}
}
}
public boolean create()
{
if (shapes != null)
{
Shape shape = shapes.addPicture("C:/pic.jpg");
shape.setPlugID(1);
shape.setPlugSubID(0);
return true;
}
return false;
}
}
|
|