0

我一直在向 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],但它只是在所有图像之后添加返回。任何帮助,将不胜感激。

4

1 回答 1

0

您是否尝试使用:

Selection.InsertParagraphAfter
Selection.Move

这可能是您正在寻找的东西?Next在语句之前添加行。

于 2013-03-08T10:38:00.777 回答