none
How to save doc without vba macros from dotm template RRS feed

  • Question

  • I created word template dotm file containing AutoClose macro. Macro only asks to save or not new created docx file.When I save new docx file it contains macro as well ! How to avoid this ?

    Below you can find my AutoClose macro :

            

    Sub AutoClose()

        ChDir "D:\TechDoc\PLM\INFOR_INCIDENTS"
        katalog = "Dezamet" & Year(Date) & Right("0" & Month(Date), 2) & Right("0" & Day(Date), 2) & Right("0" & Hour(Time), 2) & Right("0" & Minute(Time), 2)
        sciezka = CurDir & "\" & katalog
        x = MsgBox("Czy zapisać plik ?", vbYesNo)
        If x = 6 Then
            MkDir (sciezka)
            ChDir sciezka
            ActiveDocument.SaveAs2 FileName:=sciezka & "\" & katalog & ".docx"
        End If
        If x = 7 Then
           Application.Quit
        End If


    End Sub

    Thursday, January 28, 2016 2:51 PM

Answers