【发布时间】:2016-06-13 21:02:41
【问题描述】:
循环粘贴 .emf 文件到 word 中的简单代码:
Sub LoopEMF()
Dim sPic As String
Dim sPath As String
sPath = "C:\Users\me\Desktop\Test2\"
sPic = Dir(sPath & "*.emf")
Do While sPic <> ""
Selection.TypeParagraph
Selection.InlineShapes.AddPicture _
FileName:=sPath & sPic, _
LinkToFile:=False, SaveWithDocument:=True
sPic = Dir
Selection.TypeParagraph
Loop
End Sub
我只想查看word文件(即打开的)所在的活动目录,而不是指定目录。很多搜索都没有找到任何线索——这令人惊讶、尴尬,并且可能意味着我没有使用正确的关键词。
帮助?
【问题讨论】: