Dim doc As Word.Document
Dim wmodulo As Word.Application
Dim i, a As Integer
Dim filepath, filepath2 As String
filepath = "Q:ComuneLP"
filepath2 = "Q:ComuneLPMario"
Set wmodulo = CreateObject("Word.Application")
i=20
For a = 1 To i
FileCopy filepath & "LP BASE.docx", filepath2 & "LP " & a & " " & Format(Now(), "yyyy-mm-dd") & " .docx"
Set doc = wmodulo.Documents.Open(filepath2 & "LP " & a & " " & Format(Now(), "yyyy-mm-dd") & " .docx")
With doc
.Bookmarks("gross").Select
wmodulo.Selection.TypeText Format(Range("g" & a), "###,####,###.00")
End With
wmodulo.Quit
Set doc = Nothing
Set wmodulo = Nothing
Next
|