PDA

View Full Version : Macro to check the file extension



dineshde
06-05-2013, 07:36 AM
Hallo Everyone,

Iam very new to this VBA or Macro.. I want to create a word template with macro where the user try to save the word 2010(.docx) to 97-2003(.doc) i have to disable the option or to give them a msg that it has to saved only in .docx format.

How can i do this ?..

thank you..

xls
06-15-2013, 11:14 PM
Dinesh try this,

Sub FileSaveAs()

With Dialogs(wdDialogFileSaveAs)
.Format = 12
If .Display = 0 Then Exit Sub
If .Format = 12 Then
.Execute
Else
MsgBox ("You are only allowed to save in docx format. Please try again")
Call FileSaveAs
' Exit Sub
End If
End With
End Sub

HTH//XLS