原创不容易,请不要抄袭!
配置工作
EXCEL 2010版本以上配置
- 文件-选项-自定义功能区-主选项卡-勾选开发者选项
- 打开开发者选项里的Visual Basic, 选择工具-引用-勾选Microsoft Powerpoint 14.0 Object Library
开发
- 打开Visual Basic 在工程框里相应的EXCEL下新建模块,此时会弹出模块1(代码)
- 编写两个VB函数getshapedata() 和 writedata()
Dim ppapp As PowerPoint.Application
Dim pppres As PowerPoint.Presentation
Sub getshapedata()
'On Error GoTo line1
Set ppapp = GetObject(, "powerpoint.application")
Set pppres = ppapp.ActivePresentation
Dim shapename
Dim shapeslide
Dim shapetext
Dim nextrow
shapeslide = ppapp.ActiveWindow.View.Slide.SlideIndex
shapename = ppapp.ActiveWindow.Selection.ShapeRange(1).Name
shapetext = pppres.Slides(shapeslide).Shapes(shapename).TextEffect.Text
'friendlyname = InputBox("insert one name" & shapetext, "Friendly Name", "")