如何在VC中更改PPT的背景色,字体颜色,字体
_Application app;
Presentations presentations;
_Presentation presentation;
Slides slides;
_Slide slide;
ShapeRange shaperange;
Shapes shapes;
Shape shape;
TextFrame textframe;
TextRange textrange;
Font font;
FillFormat fillformat;
ColorFormat colorformat;
ShadowFormat shadow;
if(!app.CreateDispatch("Powerpoint.Application", &e))
{
CString str;
str.Format("CreateDispatch() failed w/err 0x%08lx", e.m_sc),
AfxMessageBox(str, MB_SETFOREGROUND);
return;
}
app.SetVisible(TRUE); Presentations presSet(app.GetPresentations());
_Presentation pres(presSet.Add(TRUE));
Slides slideSet(pres.GetSlides());
_Slide slide1(slideSet.Add(1, 2));
// Add text to slide, by navigating the slide as follows:
// slide1.shapes(#).TextFrame.TextRange.Text
{
Shapes shapes(slide1.GetShapes());
Shape shape(shapes.Item(COleVariant((long)1)));
TextFrame textFrame(shape.GetTextFrame());
TextRange textRange(textFrame.GetTextRange());
textRange.SetText("My first slide");
}
{
Shapes shapes(slide1.GetShapes());
Shape shape(shapes.Item(COleVariant((long)2)));
TextFrame textFrame(shape.GetTextFrame());
TextRange textRange(textFrame.GetTextRange());
textRange.SetText("Automating PowerPoint is easy\r\n"
"Using Visual C++ is powerful!我是中国人");
font = textrange.GetFont();
font.SetName("华文行楷"); //Set the font name.
font.SetSize((float)48);
}
现在字体的大小、加粗,斜体属性都可以改,但就是字体的颜色改不了,还有,写的东西英文是华文行楷,汉语就不是,是默认的宋体,不知为什么! 请高手赐教!!
Presentations presentations;
_Presentation presentation;
Slides slides;
_Slide slide;
ShapeRange shaperange;
Shapes shapes;
Shape shape;
TextFrame textframe;
TextRange textrange;
Font font;
FillFormat fillformat;
ColorFormat colorformat;
ShadowFormat shadow;
if(!app.CreateDispatch("Powerpoint.Application", &e))
{
CString str;
str.Format("CreateDispatch() failed w/err 0x%08lx", e.m_sc),
AfxMessageBox(str, MB_SETFOREGROUND);
return;
}
app.SetVisible(TRUE); Presentations presSet(app.GetPresentations());
_Presentation pres(presSet.Add(TRUE));
Slides slideSet(pres.GetSlides());
_Slide slide1(slideSet.Add(1, 2));
// Add text to slide, by navigating the slide as follows:
// slide1.shapes(#).TextFrame.TextRange.Text
{
Shapes shapes(slide1.GetShapes());
Shape shape(shapes.Item(COleVariant((long)1)));
TextFrame textFrame(shape.GetTextFrame());
TextRange textRange(textFrame.GetTextRange());
textRange.SetText("My first slide");
}
{
Shapes shapes(slide1.GetShapes());
Shape shape(shapes.Item(COleVariant((long)2)));
TextFrame textFrame(shape.GetTextFrame());
TextRange textRange(textFrame.GetTextRange());
textRange.SetText("Automating PowerPoint is easy\r\n"
"Using Visual C++ is powerful!我是中国人");
font = textrange.GetFont();
font.SetName("华文行楷"); //Set the font name.
font.SetSize((float)48);
}
现在字体的大小、加粗,斜体属性都可以改,但就是字体的颜色改不了,还有,写的东西英文是华文行楷,汉语就不是,是默认的宋体,不知为什么! 请高手赐教!!
...全文
相关推荐
(VC6源代码)编辑框,静态框等改变背景色和字体颜色
VC6源代码)编辑框,静态框等改变背景色和字体颜色,主要是一些小控件的颜色改变方法。可以供大型软件借用
常用VC控件大小及颜色修改
一、改变视图背景色: 1 二、改变对话框背景色: 1 三、窗口居中: 2 四、设置初始窗口状态: 2 五、对话框透明特效: 2 六、设置对话框里的STATIC控件颜色属性: 3 七、使窗口的最大化和最小化按钮消失: 3 八、设置控件字体颜色:(例如STATIC控件) 3 九、修改单文档程序的标题: 4 十、自绘菜单宽度不对,高度是对的,解决办法: 4 十一、对话框由小到大显示的动画效果: 4 十二、位图按钮: 5
改变任意窗体内字体的大小及颜色VC 代码.rar
改变任意窗体内字体的大小及颜色VC 代码,将常规的字体大小自定义为你想要的大小,并且可以改变字体的颜色。
改变 CListCtrl高度、字体、颜色和背景的实例
使用重用类,可以轻松改变 CListCtrl、CHeaderCtrl 高度、字体、颜色和背景,有vc6实例
visual c++ vc改变字体和颜色.zip
visual c++ vc改变字体和颜色.zip


