我是vba ppt的新手,如果这个问题措辞严厉,我很抱歉
如何使用diff数据库数据创建多组幻灯片1-4?
(我可以创建多个集合,但我不能插入数据库数据)
例如:
第1组1-4是来自SeqNo:1
的数据第2组1-4是来自SeqNo:2的数据
我的代码:
conn.Open cs
query = "SELECT SeqNo, SeqData from Seqtab ORDER BY SeqNo DESC;"
rs.Open query, conn
row = 0
Do Until rs.EOF
Dim myPres As Presentation
Dim mySlide As SlideRange
Dim count As Long
Set myPres = ActivePresentation
Dim sldRng As PowerPoint.SlideRange
Set sldRng = ActivePresentation.Slides(1).Duplicate
sldRng.Shapes(1).TextFrame.TextRange = rs.Fields("SeqNo ").Value
sldRng.Shapes(2).TextFrame.TextRange = rs.Fields("SeqData").Value
答案 0 :(得分:1)
如果您复制了一系列幻灯片,您将获得一系列幻灯片,以便为参考定义幻灯片范围
Dim sldRng as PowerPoint.SlideRange
Set sldRng = ActivePresentation.Slides.Range(Array(1, 2, 3, 4)).Duplicate