
Sub Inseriscimmagini() Dim nCounter As Integer Dim nCounterFile As String For nCounter = 1 To 50 If nCounter < 10 Then nCounterFile = "00" & nCounter Selection.InlineShapes.AddPicture FileName:="C:Immagini" & nCounterFile & ".jpg", LinkToFile:=False, SaveWithDocument:=True Documents.Item(1).Select Selection.EndKey Unit:=wdStory Selection.TypeParagraph Selection.InsertBreak Type:=wdPageBreak Next End Sub |
Sub Inseriscimmagini()
Dim nCounter As Integer
Dim nCounterFile As String
Application.ScreenUpdating = False
For nCounter = 1 To 50
If nCounter < 10 Then
nCounterFile = "00" & nCounter
Else
nCounterFile = "0" & nCounter
End If
Selection.InlineShapes.AddPicture FileName:="C:UsersDesktopImmagini" & nCounterFile & ".jpg"
Documents.Item(1).Select
With Selection.InlineShapes.Item(nCounter)
.Height = 500 'Altezza
.Width = 450 'Larghezza
End With
If nCounter = 50 Then Exit Sub
With Selection
.EndKey Unit:=wdStory
.TypeParagraph
.InsertBreak Type:=wdPageBreak
End With
Next
Application.ScreenUpdating = True
End Sub
|
