“NEW BING采用GPT4训练模型,可以免费使用。今天我们通过new bing来模拟微软 功能,快速生成一份PPT演示文档。”
先说下今天的整体思路。微软-的官方演示中,通过告知需要的文档主题,会通过自然语义理解、上下文关系、信息组织整理完成文档信息,并采用微软设计灵感和内置模板库完成整体PPT美化。
这里我们拆解为两个步骤:
01 :使用new bing准备PPT的大纲和细节要求。
02 :使用内置的设计功能,完成PPT的简单排版和美化
这中间涉及到大纲转幻灯片的操作,由于我们不借助任何第三方软件,这里我们会使用自带的VBA工具实现这一功能。
接下来我们细化以下要求:
PPT主题:《介绍世界五大最高峰的》
PPT页数:7页
PPT结构:1页封面、5页介绍、1页封底
介绍内容:每座高峰至少介绍3个信息。
01
—
使用New Bing生成内容和自动化VBA
魔法指令: write me vba code to 6 about top 5 world a cover as the first page. Each slide comes with a short from 3 and an image of the from .
中文翻译:请为我编写VBA代码,创建6张关于世界上最著名的5幅画的幻灯片,包括第一页的封面。每张幻灯片都附有一个简短的描述,从3个不同的方面和维基百科上的画作图片。
new bing会很快帮我们将VBA代码写出来。如果代码过长导致输出不完整。我们可以使用补充指令:
魔法指令: to the code from where you stop.
中文翻译:请继续完成代码
得到以下代码,我们就可以使用自带的VBA宏,模拟微软- 生成PPT文件了。
Sub CreateSlides()
' Declare variables
Dim pptApp As PowerPoint.Application
Dim pptPres As PowerPoint.Presentation
Dim pptSlide As PowerPoint.Slide
Dim pptShape As PowerPoint.Shape
Dim pptText As PowerPoint.TextRange
Dim i As Integer
Dim paintings As Variant
Dim titles As Variant
Dim descriptions As Variant
Dim urls As Variant
' Initialize arrays of paintings, titles, descriptions and urls
paintings = Array("Mona Lisa", "The Last Supper", "Girl with a Pearl Earring", "Guernica", "The Starry Night")
titles = Array("Mona Lisa by Leonardo da Vinci", "The Last Supper by Leonardo da Vinci", "Girl with a Pearl Earring by Johannes Vermeer", "Guernica by Pablo Picasso", "The Starry Night by Vincent van Gogh")
descriptions = Array("This painting is one of the most famous and mysterious portraits in the world. It depicts a woman with an enigmatic smile and a landscape background. Some believe that she is Lisa Gherardini, the wife of a Florentine merchant, while others suggest that she is Leonardo's mother or even himself in drag.", _
"This painting is a masterpiece of Renaissance art that shows the scene of Jesus and his disciples having their final meal before his crucifixion. Leonardo used perspective and gestures to create a dramatic and realistic composition. He also painted each disciple with a distinct personality and reaction to Jesus' announcement of his betrayal.", _
"This painting is a stunning example of Dutch Golden Age art that captures the beauty and innocence of a young woman. She wears an exotic turban and a large pearl earring, and looks over her shoulder at the viewer with a curious expression. Some think that she is Vermeer's maid or daughter, but her identity remains unknown.", _
"This painting is a powerful anti-war statement that depicts the horrors of the bombing of Guernica, a Basque town in Spain, during the Spanish Civil War. Picasso used a monochromatic palette and distorted figures to convey the suffering and chaos of the event. He also included symbols of Spanish culture, such as the bull and the horse.", _
"This painting is one of the most famous and beloved works of modern art that expresses the artist's emotions and vision. It shows a swirling night sky over a small village and a cypress tree. Van Gogh painted it from memory while staying at an asylum in Saint-Remy-de-Provence, France.")
urls = Array("https://upload.wikimedia.org/wikipedia/commons/thumb/e/ec/Mona_Lisa%2C_by_Leonardo_da_Vinci%2C_from_C2RMF_retouched.jpg/1200px-Mona_Lisa%2C_by_Leonardo_da_Vinci%2C_from_C2RMF_retouched.jpg", _
"https://upload.wikimedia.org/wikipedia/commons/thumb/0/08/Leonardo_da_Vinci_%281452-1519%29_-_The_Last_Supper_%281495-1498%29.jpg/1920px-Leonardo_da_Vinci_%281452-1519%29_-_The_Last_Supper_%281495-1498%29.jpg", _
" https://upload.wikimedia.org/wikipedia/commons/thumb/0/0f/1665_Girl_with_a_Pearl_Earring.jpg/1280px-1665_Girl_with_a_Pearl_Earring.jpg", _
"https://upload.wikimedia.org/wikipedia/en/thumb/7/74/PicassoGuernica.jpg/1920px-PicassoGuernica.jpg", _
"https://upload.wikimedia.org/wikipedia/commons/thumb/e/ea/Van_Gogh_-_Starry_Night_-_Google_Art_Project.jpg/1920px-Van_Gogh_-_Starry_Night_-_Google_Art_Project.jpg")
' Create a new PowerPoint application and presentation
Set pptApp = New PowerPoint.Application
Set pptPres = pptApp.Presentations.Add
' Create a cover slide with title and subtitle
Set pptSlide = pptPres.Slides.Add(1, ppLayoutTitle)
Set pptText = pptSlide.Shapes(1).TextFrame.TextRange
pptText.Text = "Top 5 World Famous Paintings"
Set pptText = pptSlide.Shapes(2).TextFrame.TextRange
pptText.Text = "A PowerPoint presentation created by Bing"
' Loop through the paintings array and create a slide for each one
For i = 0 To 4
' Create a blank slide
Set pptSlide = pptPres.Slides.Add(i + 2, ppLayoutBlank)
' Add a title with the painting name and artist
Set pptShape = pptSlide.Shapes.AddTextbox(msoTextOrientationHorizontal, 50, 50, 600, 50)
Set pptText = pptShape.TextFrame.TextRange
pptText.Text = titles(i)
pptText.Font.Size = 24
pptText.Font.Bold = True
' Add a picture of the painting from the url
Set pptShape = pptSlide.Shapes.AddPicture(urls(i), msoFalse, msoTrue, 50, 150, 400, 300)
' Add a text box with the description of the painting
Set pptShape = pptSlide.Shapes.AddTextbox(msoTextOrientationHorizontal, 500, 150, 300, 300)
Set pptText = pptShape.TextFrame.TextRange
pptText.Text = descriptions(i)
pptText.Font.Size = 18
Next i
' Save the presentation as a PowerPoint file
pptPres.SaveAs "Top 5 World Famous Paintings.pptx"
' Close the presentation and quit the application
pptPres.Close
pptApp.Quit
' Release the variables
Set pptApp = Nothing
Set pptPres = Nothing
Set pptSlide = Nothing
Set pptShape = Nothing
Set pptText = Nothing
End Sub
接下来,我们按如下步骤操作:
01 – 打开,
02 – 点击菜单的开发者选项
03 – 点击最左侧VBA宏-
04 – 在VBA窗口点击插入-模块,
05 – 输入上方代码,并点击
运行代码。
运行中,会看到如下界面,耐心等待后, 会自动关闭。
请不要担心。这是因为提供的代码最后,使用了自动关闭的代码语法。
接下来,我们打开“我的文档”,并找到刚才保存的文件。sj – xwdjn替换为自己的文档地址。
"C:UserssjOneDrive - xwdjnDocumentsTop 5 World Famous Paintings.pptx"
02
—
使用设计灵感完成PPT美化
我们已经看到6页幻灯片已经以简单的左右结构呈现在面前。接下来,要求我们具有一个权限的账号。这里可以自行准备一下,或给我留言,我会在后面补充获取的方法。
第一步:使用自带的设计菜单,选择合适的主题。这里我们选一个文艺一些的浅色主题。
第二步:使用设计灵感功能,对每一页PPT进行快速的排版
开始(home)-设计灵感()
第三步:我们导出为PDF,查看整体的效果。
至此,认为模仿微软-工作流方式生成PPT的实战就结束了。
最后还是有几点要说明:
每个人的或者是,每一次生成的结果都是不同的。同样的需求,编程代码也有不同的实现思路,所以大家还是要对vba原理有一定的基础了解。
文中代码有一处图片链接是错误的,会导致代码报错,解决思路大家可以留言交流。
还是那句话,人工智能的出现对于基础经验丰富且愿意接受新事物的人来说,是巨大的生产力提升,人工智能目前还是只能作为助手存在,我们还是应该丰富自己的技能栈,做到不被工具淘汰。