title: How to display Word Document?
body: <p>how can display the document from this code:</p>
  
  <pre><code>Dim xTable As Word.Table
  Dim xDoc As Word.Document
  Dim xExcel As Excel.Application
  Dim xWb As Workbook
  Dim xWs As Worksheet
  Dim i As Integer
  Dim xRow As Integer
  Set xWb = ActiveWorkbook
  Set xWs = xWb.Sheets(1)
  xRow = 1
  Count = 0
  
  folName = InputBox("Schreiben Sie bitte den Name des Ordners", "Ordner Name", "AZ xx.xx.xxxx")
  If folName = "" Then Exit Sub
  
  Dim strMailboxName As String: strMailboxName = "Inkasso Webpost"
  Set myfolder = Session.Folders(strMailboxName).Folders("Folders").Folders(folName)
  Set ActiveExplorer.CurrentFolder = myfolder
  Set SubFolderEmail = Session.Folders(strMailboxName).Folders("Folders").Folders("Erledigte")
  
  
  For Each maill In myfolder.Items
  
  
  Set xDoc = maill.GetInspector.WordEditor 'loop through all E/Mails in folder
  
  
      For ss = 1 To xDoc.Tables.Count 'search table in the E/Mail
  
          If xDoc.Tables.Count = 0 Then
              Exit For
          Else
              Count = Count + 1
  
      Set xTable = xDoc.Tables(ss) 'download the table from E/Mail into Excel
          Range("A" &amp; xRow).Select
          xTable.Range.Copy
          xWs.Paste
          xRow = Range("A" &amp; Rows.Count).End(xlUp).Row + 3
  
          End If
      Next
  Next
  </code></pre>
  
  <p>When I set my mouse on <code>xDoc</code> I see that xDoc have a name - <code>Dokument1</code>, <code>Dokument2</code>, <code>Dokument3</code> etc.</p>
  
  <p>How can I  open this doc?</p>
  
  <p>And when the doc gets to Number 71 I receive an error (error is, that the dokument can no longer change its name). How can I delete or close these 71 documents?</p>