上面是“插入图片”的功能,接着是取得图片路径名,可以直接代替:“Const fileName As String = "C:\AAAA.png"” Function strGetFilePath() As String Dim fd As FileDialog Dim strFilePath As String Set fd = Application.FileDialog(msoFileDialogFilePicker) Dim vrtSelectedItem As Variant With fd If .Show = -1 Then For Each vrtSelectedItem In .SelectedItems 'MsgBox "The path is: " & vrtSelectedItem strFilePath = vrtSelectedItem Next vrtSelectedItem Else strFilePath = "" End If End With strGetFilePath = strFilePath Set fd = Nothing End Function |
|
来自: vbavsto > 《WORD-vba》