vba - how to RESIZE the imported picture with factor scaling using VBA in powerpoint 2016?
问题描述
this script imports the image from a random folder and place it on current slide. But I need to resize or rescaling with factors (0% to 100%) . Please help me on addition to this script...
'''
Sub insert_pic()
Dim osld As Slide
Dim oFD As FileDialog
Dim sFile As String
Dim opic As Shape
Dim sFolder As String
Set osld = ActiveWindow.View.Slide
Set oFD = Application.FileDialog(msoFileDialogFilePicker)
sFolder = "C:\Autodesk\iNSERT_iMAGE\"
With oFD
.InitialFileName = sFolder
.AllowMultiSelect = False
.Filters.Clear
.Filters.Add "Pictures", "*.EMF, *.PNG ,*.BMP"
If .Show = msoTrue Then sFile = .SelectedItems(1)
End With
If sFile <> "" Then
Set opic = osld.Shapes.AddPicture(FileName:=sFile, _
Top:=15, _
Left:=0, _
Height:=True, _
Width:=True, _
LinKToFile:=msoFalse, _
SaveWithDocument:=msoTrue)
End If
End Sub
'''
解决方案
推荐阅读
- python - 尝试使用 pandas.read_gbq() 函数时,pandas-gbq 抛出错误“找不到字段 google.protobuf.FileOptions.php_metadata_namespace”
- asp.net-core - 带有 VSCode 和 VS 2019 的 ASP.NET Core 前端开发人员工作流
- sql - 为什么“IN”查询标签在sql存储过程中的开销如此之大?
- angular - 如何以角度获取 URL?
- c# - 为什么使用“RenderTargetBitmap”类会使 GDI 句柄数增加?
- encryption - GPG - 以非交互方式更改密码
- c# - PayPal - 如何在 PayPal 订单请求正文中动态创建订单项?
- curl - 仅从 FTP 下载二进制文件的标头
- crystal-reports - 水晶报表如何向下然后跨栏
- django - 我需要在 Kubernetes 中使用 NGINX 来进行 Flask/Django 部署吗?