Sub CATMain()
' Variables declaration
Dim oDrwDocument As DrawingDocument
Dim oDrwSheets As DrawingSheets
Dim oDrwSheet As DrawingSheet
Dim oDrwView As DrawingView
Dim oDrwTables As DrawingTables
Dim oDrwTable As DrawingTable
Set oDrwDocument = CATIA.ActiveDocument
' Set the drawing document standard
CATIA.DisplayFileAlerts = False
Dim Message, Style, Title, Response, MyString
Message = ("This macro will change the drawing standard according to what user will choose" &_
(chr(13)) &_
" - The active document must be a CATDrawing (local or VPM)"&_
(chr(13)) &_
" - Drawing size will go automatically to the biggest standard format"&_
(chr(13)) &_
""&(chr(13))&_
" Do you want to continue ?")
Style = vbYesNo + vbDefaultButton2 'Define buttons.
Title = "Purpose "
Response = MsgBox(Message, Style, Title)
If Response = vbYes Then ' User chose Yes.
Dim myStringcase 'As Double
myStringcase = "1"
myStringcase = InputBox ("Please enter the case" & chr(13) & "1 for ISO" & chr(13) & "2 for ANSI" & chr(13) & "3 for JIS" , "Standard case" , myStringcase)
If myStringcase = 1 Then
oDrwDocument.Standard = catISO
ElseIf myStringcase = 2 Then
oDrwDocument.Standard = catANSI
ElseIf myStringcase = 3 Then
oDrwDocument.Standard = catJIS
Else
End If
'~ Bellow code will work only for ISO standard, if you want to set the size for other standards you need corect name, like catPaperA3
'~ Uncomment to make it work
'~ ' Retrieve the drawing document's sheets collection
'~ Set oDrwSheets = oDrwDocument.Sheets
'~ ' Retrieve the active sheet
'~ Set oDrwSheet = oDrwSheets.ActiveSheet
'~ ' Set the sheet properties
'~ oDrwSheet.PaperSize = catPaperA3
'~ oDrwSheet.Orientation = catPaperLandscape
'~ oDrwSheet.Scale2 = 1
CATIA.ActiveDocument.Update
End If