如何在图像之间添加段落?

时间:2013-03-08 10:29:09

标签: vba import openfiledialog

我一直在为Word中的customUi菜单添加一系列按钮。其中一个按钮从服务器上的库文件夹中导入一个或多个图像,但是当它将它们添加到页面时,我无法在每个图像之间放置一个段落返回。

With fd
    .InitialFileName = strFolder & "\*.png; *.jpg; *.gif"
    .ButtonName = "Insert"
    .AllowMultiSelect = True  ' Make multiple selection
    .Title = "Choose one or more pictures from the library"
    .InitialView = msoFileDialogViewPreview

'Sets the initial file filter to number 2.
'    .FilterIndex = 2

'Use the Show method to display the File Picker dialog box and return the user's action.
'If the user presses the action button...
If .Show = -1 Then
'Step through each string in the FileDialogSelectedItems collection.
    For Each vrtSelectedItem In .SelectedItems
'vrtSelectedItem is a String that contains the path of each selected item.
    Selection.InlineShapes.AddPicture FileName:= _
                  vrtSelectedItem _
                , LinkToFile:=False, SaveWithDocument:=True

    Next vrtSelectedItem

我尝试在各个地方添加一个段落行[Selection.TypeParagraph],但它只是在所有图像之后添加了返回。 任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:0)

你是否尝试使用:

Selection.InsertParagraphAfter
Selection.Move

这可能是你在找什么? 在Next语句之前添加行。

相关问题