用于在 Powerpoint 2010 中将方程转换为图像的宏

编程入门 行业动态 更新时间:2024-10-13 20:16:44
本文介绍了用于在 Powerpoint 2010 中将方程转换为图像的宏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试准备一个宏,将 PowerPoint2010 演示文稿中的所有方程转换为图像,同时保留位置和动画效果/顺序.

I am trying to preapre a macro that would convert all equations in a PowerPoint2010 presentation into images while retaining the position and animation effect/order.

基于在此处提供的提示(感谢Steve Rindsberg),我修改了脚本如下:

Based on the tip provided here (thanks to Steve Rindsberg), I have modified the script as below:

Sub ConvertAllShapesToPic() Dim oSl As Slide Dim oSh As Shape On Error Resume Next For Each oSl In ActivePresentation.Slides For Each oSh In oSl.Shapes ' modify the following depending on what you want to ' convert Select Case oSh.Type Case msoTextBox, msoEmbeddedOLEObject, msoLinkedOLEObject ConvertShapeToPic oSh Case Else End Select Next Next NormalExit: Exit Sub ErrorHandler: Resume Next End Sub Sub ConvertShapeToPic(ByRef oSh As Shape) Dim oNewSh As Shape Dim oSl As Slide Set oSl = oSh.Parent oSh.Copy Set oNewSh = oSl.Shapes.PasteSpecial(ppPasteEnhancedMetafile)(1) oSh.PickupAnimation oNewSh.ApplyAnimation With oNewSh .Left = oSh.Left .Top = oSh.Top Do .ZOrder (msoSendBackward) Loop Until .ZOrderPosition = .ZOrderPosition .AnimationSettings.AnimationOrder = oSh.AnimationSettings.AnimationOrder End With oSh.Delete NormalExit: Exit Sub ErrorHandler: Resume Next End Sub

此脚本的问题:

  • 所有方程都没有转换成图像.
  • 一些没有方程的文本框失去了它们的内部动画效果(例如在点击时显示第二个项目符号文本).
  • 我准备这个脚本的原因是,当我将 PowerPoint 2010 转换为 Articulate 演示文稿时,由于 Articulate 09 不完全支持 PPT2010 方程,因此无法正确呈现方程.

    My reason for preparing this script is because when I convert PowerPoint 2010 into Articulate presentations, the equations are not getting rendered properly since Articulate 09 does not fully support PPT2010 equations.

    我有 100 多个 PPT,几乎所有幻灯片上都有方程式.如果没有编程方法,唯一的选择就是手动转换所有方程并重新应用动画效果!

    I have more than 100 PPTs, with equations on nearly all slides. Without a programmatic method, the only option would be to convert all the equations manually and reapply the anim effects!

    感谢您提供的任何帮助:-)

    Appreciate any help that you can offer :-)

    谢谢!

    推荐答案

    至于第一个问题,我的不好:

    As to the first problem, my bad:

    为此:

    For Each oSl In ActivePresentation.Slides For Each oSh In oSl.Shapes ' modify the following depending on what you want to ' convert Select Case oSh.Type Case msoTextBox, msoEmbeddedOLEObject, msoLinkedOLEObject ConvertShapeToPic oSh Case Else End Select Next Next

    替换:

    Dim x as long For x = ActivePresentation.Slides.Count to 1 Step -1 Set oSl = ActivePresentation.Slides(x) For Each oSh In oSl.Shapes ' modify the following depending on what you want to ' convert Select Case oSh.Type Case msoTextBox, msoEmbeddedOLEObject, msoLinkedOLEObject ConvertShapeToPic oSh Case Else End Select Next Next

    当我最初写这篇文章时,我可能只用每张幻灯片一个方程来测试幻灯片.当您单步执行集合并可能删除成员时,您需要向后单步执行,否则删除成员时索引会变得混乱.

    I probably only tested slides with one equation per slide when I wrote this originally. When you step through a collection and possible delete members, you need to step through backwards, else the indexing gets messed up when you delete a member.

    更多推荐

    用于在 Powerpoint 2010 中将方程转换为图像的宏

    本文发布于:2023-10-31 10:53:56,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1545873.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:转换为   方程   中将   图像   Powerpoint

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!