BCB 控制插入WORD图片的大小
vSelect.OlePropertyGet("inlineshapes").OleFunction("AddPicture",(ExtractFilePath(ParamStr(0))+"Image_A.jpg").c_str(),false,true);这是我插入图片的语句,但是不知道怎么控制大小,在线等,
[解决办法]
OLE专业户来也!!!
- C/C++ code
Variant vWordApp;try{ vWordApp = Variant::CreateObject("Word.Application");}catch(...){ MessageBox(Handle, "启动Word出错!", Application->Title.c_str(), MB_OK | MB_ICONERROR); return;}vWordApp.OlePropertySet("Visible", true);WideString strDocName = "D:\\ccrun\\123.doc";Variant vDoc = vWordApp.OlePropertyGet("Documents"). OleFunction("Open", strDocName);WideString strPicFile = "D:\\ccrun\\123.jpg";Variant vShape = vWordApp.OlePropertyGet("Selection") .OlePropertyGet("InlineShapes").OleFunction("AddPicture", strPicFile, false, true);// 设置图片宽100,高100vShape.OlePropertySet("Width", 100);vShape.OlePropertySet("Height", 100);