title: VBA table into outlook, loses proper format
body: <p>I'm using the code from Ron De Bruin to embed a table into an email in Outlook (<a href="http://www.rondebruin.nl/win/s1/outlook/bmail2.htm" rel="nofollow noreferrer">http://www.rondebruin.nl/win/s1/outlook/bmail2.htm</a>). However, when it goes into the email, my the space between the numbers and then border disppears and the numbers are basically touching it. How can I get this space to stay/come back?</p>
  
  <p>EDIT: HTML Code part follows</p>
  
  <pre><code>Function RangetoHTML(rng As Range)
  Dim fso As Object
  Dim ts As Object
  Dim TempFile As String
  Dim TempWB As Workbook
  
  TempFile = Environ$("temp") &amp; "/" &amp; Format(Now, "dd-mm-yy h-mm-ss") &amp; ".htm"
  
  rng.Copy
  Set TempWB = Workbooks.Add(1)
  With TempWB.Sheets(1)
   .Cells(1).PasteSpecial Paste:=8
      .Cells(1).PasteSpecial xlPasteValues, , False, False
      .Cells(1).PasteSpecial xlPasteFormats, , False, False
      .Cells(1).Select
      Application.CutCopyMode = False
      On Error Resume Next
      .DrawingObjects.Visible = True
      .DrawingObjects.Delete
      On Error GoTo 0
  End With
  
  
  
  
  With TempWB.PublishObjects.Add( _
       SourceType:=xlSourceRange, _
       FileName:=TempFile, _
       sheet:=TempWB.Sheets(1).Name, _
       Source:=TempWB.Sheets(1).UsedRange.Address, _
       HtmlType:=xlHtmlStatic)
      .Publish (True)
  End With
  
  
  Set fso = CreateObject("Scripting.FileSystemObject")
  Set ts = fso.GetFile(TempFile).OpenAsTextStream(1, -2)
  RangetoHTML = ts.readall
  ts.Close
  RangetoHTML = Replace(RangetoHTML, "align=center x:publishsource=", _
                        "align=left x:publishsource=")
  
  TempWB.Close Savechanges:=False
  
  Kill TempFile
  
  Set ts = Nothing
  Set fso = Nothing
  Set TempWB = Nothing
  
  End Function
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/B637I.jpg" alt="enter image description here"></p>