有谁知道为什么每次循环 for next 循环时,我都会在任务管理器中运行 word 的后台进程?谢谢。
Try
For Each element In Raneeded
If Not String.IsNullOrEmpty(element) Then
Dim OpenRA = New Microsoft.Office.Interop.Word.Application
docname = d(CInt(element)) & ".docx"
OpenRA.Documents.Open(folderpath & docname)
OpenRA.Visible = False
Dim opened1 = OpenRA.ActiveDocument
Dim RAtable As Word.Table = opened1.Tables(1)
RAtable.Cell(1, 1).Range.Text = "Site Address: " & address
opened1.Close()
End If
Next
Catch ex As Exception
MsgBox(ex.Message & " Please contact your system Administrator, quoting these details.")
End Try