- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我知道 PowerPoint 有类似 Excel 和 word 的 API。有没有办法以编程方式生成时间线路线图(我有一个来自数据库的里程碑和日期列表)?
是否有人有关于如何开始尝试以编程方式在 powerpoint 中填写时间线路线图模板的任何链接或示例代码
这是我正在尝试做的(不是很好)示例:http://www.jumpdesign.net/aboutcd/02history/Short_history_timeline.jpg
最佳答案
好的,这仍然需要大量的工作,但希望这足以让您入门。
Sub GenerateTimeLine()
Dim ap As Presentation
Set ap = ActivePresentation
'Set to first slide
Dim sl As Slide
Set sl = ap.Slides(1)
'Use Slide Master for Presentation dimensions
Dim sm As Master
Set sm = ap.SlideMaster
'Create a timeline body of 75% the width of the slide
Dim w As Integer
w = sm.Width * 0.75
'Create a timeline body of 5% the height of the slide
Dim h As Integer
h = sm.Height * 0.1
'Center horizontal position of timeline body
Dim posX As Integer
posX = Abs(w - sm.Width) / 2
'Center vertical position of timeline body
Dim posY As Integer
posY = Abs(h - sm.Height) / 2
'Add main shape
Dim timeLineBodyShape As Shape
Set timeLineBodyShape = sl.Shapes.AddShape(msoShapeRectangle, posX, posY, w, h)
'Set up initial variables
Dim timeLineBodyName As String
timeLineBodyName = "Showjumping"
Dim yearMin As Integer
Dim yearMax As Integer
yearMin = 1864
yearMax = 2006
'Add to variables timeline
With timeLineBodyShape.TextFrame
With .Ruler.TabStops
.Add ppTabStopLeft, 0
.Add ppTabStopCenter, timeLineBodyShape.Width / 2
.Add ppTabStopRight, timeLineBodyShape.Width
End With
With .TextRange
.InsertAfter CStr(yearMin) + Chr(9) + timeLineBodyName + Chr(9) + CStr(yearMax)
.Font.Bold = msoTrue
End With
End With
'Create time line nodes
Dim timeLineNodeYear As Integer
Dim timeLineNodeText As String
Dim timeLineNodeTop As Boolean
timeLineNodeYear = 1864
timeLineNodeText = "First Competition. Horse Show of the Royal Dublin Society"
timeLineNodeTop = True
AddtimeLineNode timeLineBodyShape, timeLineNodeYear, timeLineNodeText, timeLineNodeTop, _
sl, yearMin, yearMax, sm
timeLineNodeYear = 1912
timeLineNodeText = "Stockholm Olympic Games. Team competition for first time in jumping"
timeLineNodeTop = False
AddtimeLineNode timeLineBodyShape, timeLineNodeYear, timeLineNodeText, timeLineNodeTop, _
sl, yearMin, yearMax, sm
timeLineNodeYear = 1925
timeLineNodeText = "Aachen. For the first time Aachen Grand Prix"
timeLineNodeTop = True
AddtimeLineNode timeLineBodyShape, timeLineNodeYear, timeLineNodeText, timeLineNodeTop, _
sl, yearMin, yearMax, sm
timeLineNodeYear = 1953
timeLineNodeText = "Paris. For first time World Championship for men"
timeLineNodeTop = False
AddtimeLineNode timeLineBodyShape, timeLineNodeYear, timeLineNodeText, timeLineNodeTop, _
sl, yearMin, yearMax, sm
timeLineNodeYear = 1979
timeLineNodeText = "The first Volvo World Cup Final"
timeLineNodeTop = True
AddtimeLineNode timeLineBodyShape, timeLineNodeYear, timeLineNodeText, timeLineNodeTop, _
sl, yearMin, yearMax, sm
timeLineNodeYear = 1990
timeLineNodeText = "Stockholm. The first World Equestrian Games"
timeLineNodeTop = False
AddtimeLineNode timeLineBodyShape, timeLineNodeYear, timeLineNodeText, timeLineNodeTop, _
sl, yearMin, yearMax, sm
timeLineNodeYear = 2006
timeLineNodeText = "Aachen. Biggest World Equestrian Games until now"
timeLineNodeTop = True
AddtimeLineNode timeLineBodyShape, timeLineNodeYear, timeLineNodeText, timeLineNodeTop, _
sl, yearMin, yearMax, sm
End Sub
Sub AddtimeLineNode(tlShape As Shape, tlYear As Integer, tlText As String, tlTop As Boolean, _
sl As Slide, yearMin As Integer, yearMax As Integer, sm As Master)
'Positioning calculations
Dim shapeDifference As Single
shapeDifference = tlShape.Width - tlShape.Left
Dim yearDifference
yearDifference = yearMax - yearMin
Dim timeLineNodeShape As Shape
timeLineNodeShapeWidth = 100
timeLineNodeShapeHeight = 100
timeLineNodeShapePosLeft = (tlShape.Left + (((tlYear - yearMin) / yearDifference) * shapeDifference))
timeLineNodeShapePosTop = 30
If tlTop Then
Set timeLineNodeShape = sl.Shapes.AddShape(msoShapeRectangularCallout, timeLineNodeShapePosLeft, _
timeLineNodeShapePosTop, timeLineNodeShapeWidth, timeLineNodeShapeHeight)
timeLineNodeShapeMid = timeLineNodeShape.Top + timeLineNodeShape.Height / 2
timeLineBodyShapeHeight = tlShape.Height
Distance = tlShape.Top - timeLineNodeShapeMid
handleYplacement = Distance / timeLineNodeShape.Height
timeLineNodeShape.Adjustments(2) = handleYplacement
Else
timeLineNodeShapePosBottom = sm.Height - timeLineNodeShapeHeight - timeLineNodeShapePosTop
Set timeLineNodeShape = sl.Shapes.AddShape(msoShapeRectangularCallout, timeLineNodeShapePosLeft, _
timeLineNodeShapePosBottom, timeLineNodeShapeWidth, timeLineNodeShapeHeight)
timeLineNodeShapeMid = timeLineNodeShape.Top + timeLineNodeShape.Height / 2
timeLineBodyShapeHeight = tlShape.Height
Distance = (tlShape.Top + tlShape.Height) - timeLineNodeShapeMid
handleYplacement = Distance / timeLineNodeShape.Height
timeLineNodeShape.Adjustments(2) = handleYplacement
End If
timeLineNodeShape.TextFrame.TextRange = CStr(tlYear) & ", " & tlText
timeLineNodeShape.TextFrame2.AutoSize = msoAutoSizeTextToFitShape
End Sub
关于c# - 是否可以从 C# 生成 PowerPoint 路线图时间线?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3098594/
这里是执行 2 点(origin, current location){geoPoint, "current Location"} 到 Destination.{geoPoint1, "Desti L
有没有人找到 PHP 版本 6 的路线图? 此外,发布日期的任何非常粗略的 ETA(请不要回答“准备就绪时”,我只是想了解一下是 2010 年上半年、下半年等) 最佳答案 已经有一个可以使用的开发版本
有人能指出这个项目 ( Managed Service Engine ) 是否已被放弃吗? 我需要决定是否将其用作我的企业服务虚拟化计划的一部分。我目前看到来自 Microsoft 的许多竞争解决方案
由于某种原因,jQuery 模板插件 (jquery-tmpl) 的开发已被搁置。从阅读有关该主题的博客文章来看,它似乎将来会再次包含在内,或者被采用不同方法的内容所取代(例如 jsRender 和
With the recent announcement PHP 6 的开发已经停止,我对 PHP 5.x 和 6.x 路线图包含的内容感到困惑。 PHP 的当前版本是 5.3.2。 PHP 6.0
我一直在密切关注pivot 的r2dbc 更新,我希望使用这种方法构建我的应用程序。我尝试了一些带有 r2dbc postgres 驱动程序的小型应用程序,如下所示:
当我们在 Azure 上部署 ASP.CORE 3.0 时,出现以下错误: The current .NET SDK does not support targeting .NET Core 3.0
您是否计划增加从项目中检索(通过 API)所有任务的可能性,包括那些已归档的任务? 最佳答案 (我在 Asana 工作) 这将是一个有用的功能,我们已经在计划添加它。但是,我无法评论何时可以。 关于A
我一直在 Goog 上搜索,但由于技术发展如此之快,我的所有结果似乎都已过时(拂去灰尘)。 我正在寻找 MVC 的 Razor 路线图。我知道它进行了预览,但我想知道完整版本。我真的很想开始使用 Ra
关闭。这个问题需要多问focused 。目前不接受答案。 想要改进此问题吗?更新问题,使其仅关注一个问题 editing this post . 已关闭10 个月前。 Improve this que
Microsoft 是否有任何计划发布具有原生 Cordova 7、Node 4.x 支持的 Taco Update 11? 自 last update 以来,Taco 是否仍然是一个活跃的项目?是两
KDE 开发者 Nate Graham 近日公布了 KDE 桌面在 2022 年的开发路线图,列出了这个由社区驱动的开源桌面环境今年的主要开发工作。与以往公布的路线图一样,这不是一份正式的承诺,这只
我是一名优秀的程序员,十分优秀!