title: Document.SaveAs2 without saving macros
body: <p>I need to run a macro in a <code>*.docm</code> file but, once the routine it's over, the document has to be saved as a <code>.docx</code> file. After, this new file has to be opened to avoid making the final user open the file generated by himself and so, make the file's usage comfortably. <br/> <br/>I need the macro to do this because of a trusting issues. <br/> <br/>I use the code below:</p>
  
  <pre><code>Dim source As Document, copy As Document
  
  Set source = Documents(1)
  
  Dim l1 As InlineShape, l3 As InlineShape
  
  With source
      .Bookmarks("Logo1").Select
  
  'Selection.InlineShapes.AddPicture FileName:=UserForm1.Label2 &amp; UserForm1.TextBox1.Text &amp; UserForm1.Label3.caption &amp; "/logo1.jpg", _
                          LinkToFile:=False, SaveWithDocument:=True
  
  
  
      l1.LockAspectRatio = True
      l1.Height = CentimetersToPoints(2)
  
      .Bookmarks("Logo3").Select
  
  Selection.InlineShapes.AddPicture FileName:=UserForm1.Label2 &amp; UserForm1.TextBox1.Text &amp; UserForm1.Label3.Caption &amp; "/logo3.jpg", _
                          LinkToFile:=False, SaveWithDocument:=True
  
  
      l3.LockAspectRatio = True
      l3.Height = CentimetersToPoints(2)
  
      ActiveWindow.View.Type = wdPrintView
  
      GetFileName 'This is used to type the name of the file to be saved as docx
  
      Dim fName As String
  
      fName = UserForm2.TextBox1.Text &amp; UserForm2.Label2.Caption
  
      .SaveAs2 fileName:=fName, FileFormat:=wdFormatDocumentDefault, SaveFormsData:=False
      Set copy = Documents.Open fName
  
  End With
  </code></pre>
  
  <p>If I run this macro with the code pasted above, creates a <code>.docx</code> file with the same code that the <code>.docm</code>has and runs the macro again. 
  I have tried to remove the code using this function that I found in a website:</p>
  
  <pre><code>Sub DeleteAllVBACode()
      Dim VBProj As VBIDE.VBProject
      Dim VBComp As VBIDE.VBComponent
      Dim CodeMod As VBIDE.CodeModule
  
      Set VBProj = ActiveDocument.VBProject
  
      For Each VBComp In VBProj.VBComponents
          If VBComp.Type = vbext_ct_Document Then
              Set CodeMod = VBComp.CodeModule
              With CodeMod
                  .DeleteLines 1, .CountOfLines
              End With
          Else
              VBProj.VBComponents.Remove VBComp
          End If
      Next VBComp
  End Sub
  </code></pre>
  
  <p>But I get an error, so I have tried to remove it using this:</p>
  
  <p><code>copy.VBProject.VBComponents.Remove copy.VBProject.VBComponents("UserForm1")</code>
  <code>copy.VBProject.VBComponents.Remove copy.VBProject.VBComponents("Module1")</code></p>
  
  <p>After running the code with these two lines, the <code>.docx</code> has code still.</p>
  
  <p>How can I achieve it?</p>