求助:VC向WORD文档插入图片失败(急!!!)

coolcpz coolcpz 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
Word::SelectionPtr spSelection = m_pApp->Selection;
Word::InlineShapesPtr spInlineShapes = spSelection->InlineShapes;
Word::InlineShapePtr spInlineShape;
COleVariant vtTrue((short)VARIANT_TRUE);
COleVariant vtFalse((short)VARIANT_FALSE);
spInlineShape = spInlineShapes->AddPicture(_bstr_t(lpPicFile), vtFalse, vtTrue);
if (NULL != spInlineShape) {
ShapePtr shape = spInlineShape->ConvertToShape();
if (shape != NULL) {
shape->ZOrder(msoSendBehindText);
}
}

上述代码本意将图片插入到WORD中,并将图片转换成浮动格式且设置为最底层显示.但在ShapePtr shape = spInlineShape->ConvertToShape();之后,shape为空,实际上图片已经转为浮动格式,但没能够得到ShapePtr对象无法设置最底层显示.有没有做过相关方面开发的同行指教下,谢谢!!!
...全文

相关推荐

评论 3
收藏 已收藏
分享
返回顶部
coolcpz
ATL 3,248 成员 48,530 内容