将预制ppt添加到新ppt的脚本
Script to add pre-made ppt to new ppt
我有几个 ppt 文件,我想创建一个脚本来询问我想使用这些预制 ppt 文件中的哪个来创建新的演示文稿。
例子 -
我有 ppt1、ppt2、ppt3 和 ppt4。
打开脚本询问 "Select the ppt files you want to add to your new presentation",然后显示这些文件的列表。我勾选了我想要的文件(比如 ppt2 和 ppt4),当我单击“确定”时,它会获取这些文件并复制或将它们添加到新的 ppt 中,并询问我想为新演示文稿命名。就这样。我认为这很容易,但我是新手,正在寻求帮助。我已经搜索并测试了几种不同的脚本来获取 powerpoint 建议,但似乎没有任何东西是我正在寻找的,或者没有任何效果。即使是一个简单的起点,我也可以从那里开始(或者至少我希望)大声笑
提前致谢。
您可能找不到完全符合您要求的解决方案,因此我建议您起草一份 "plan" 如何实现您的要求并一步步研究。例如
- 获取可用的模板和select要使用的模板
- 要求用户提供新的 ppt 名称
- 新建ppt
- 阅读模板并将幻灯片复制到新 ppt
- 保存新ppt
第 1 步和第 2 步:
#DEMO: Create sample files
New-Item -Name "PowerPoint Templates" -ItemType Directory
New-Item -Name "ppt1.ppt" -Path '.\PowerPoint Templates' -ItemType File
New-Item -Name "ppt2.ppt" -Path '.\PowerPoint Templates' -ItemType File
New-Item -Name "ppt3.ppt" -Path '.\PowerPoint Templates' -ItemType File
New-Item -Name "ppt4.ppt" -Path '.\PowerPoint Templates' -ItemType File
#1. Get available templates and select which to use
$SelectedTemplates = Get-ChildItem -Path '.\PowerPoint Templates' |
Select-Object Name, FullName |
Out-GridView -PassThru -Title "Select the ppt files you want to add to your new presentation"
#2. Ask user for new ppt name
$OutputFileName = Read-Host "Name of new PowerPoint presentation"
我有几个 ppt 文件,我想创建一个脚本来询问我想使用这些预制 ppt 文件中的哪个来创建新的演示文稿。 例子 - 我有 ppt1、ppt2、ppt3 和 ppt4。 打开脚本询问 "Select the ppt files you want to add to your new presentation",然后显示这些文件的列表。我勾选了我想要的文件(比如 ppt2 和 ppt4),当我单击“确定”时,它会获取这些文件并复制或将它们添加到新的 ppt 中,并询问我想为新演示文稿命名。就这样。我认为这很容易,但我是新手,正在寻求帮助。我已经搜索并测试了几种不同的脚本来获取 powerpoint 建议,但似乎没有任何东西是我正在寻找的,或者没有任何效果。即使是一个简单的起点,我也可以从那里开始(或者至少我希望)大声笑 提前致谢。
您可能找不到完全符合您要求的解决方案,因此我建议您起草一份 "plan" 如何实现您的要求并一步步研究。例如
- 获取可用的模板和select要使用的模板
- 要求用户提供新的 ppt 名称
- 新建ppt
- 阅读模板并将幻灯片复制到新 ppt
- 保存新ppt
第 1 步和第 2 步:
#DEMO: Create sample files
New-Item -Name "PowerPoint Templates" -ItemType Directory
New-Item -Name "ppt1.ppt" -Path '.\PowerPoint Templates' -ItemType File
New-Item -Name "ppt2.ppt" -Path '.\PowerPoint Templates' -ItemType File
New-Item -Name "ppt3.ppt" -Path '.\PowerPoint Templates' -ItemType File
New-Item -Name "ppt4.ppt" -Path '.\PowerPoint Templates' -ItemType File
#1. Get available templates and select which to use
$SelectedTemplates = Get-ChildItem -Path '.\PowerPoint Templates' |
Select-Object Name, FullName |
Out-GridView -PassThru -Title "Select the ppt files you want to add to your new presentation"
#2. Ask user for new ppt name
$OutputFileName = Read-Host "Name of new PowerPoint presentation"