- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
FR:
Bonjour,
J'essaye de crée une Règle Ilogic permettant d'inscrire dans mes cartouches les formats de papier normé (ex : norme ISO A0, B2, C3 ...) lorsque la feuille les utilise, ou le format en mm Hauteur Largeur quand j'utilise un format Custom.
Résultat Voulut :tristanhaller_1-1649776671721.png ou
tristanhaller_0-1649776657800.png
J'ai écrit la règle ci-dessous pour lister les format "normé" mais certaines valeurs ne fonctionnent pas.
Pouvez-vous m'aider à diagnostiquer le problème?
Pouvez-vous m'aider a améliorer ce code?
Merci d'avance.
Hello,
I am trying to create an Ilogic Rule to write in my title block the standard paper sizes (ex: ISO standard A0, B2, C3 ...) when the sheet uses them, or the size in mm Height Width when I use a Custom size.
Result Wanted :
tristanhaller_1-1649776671721.png OR
tristanhaller_0-1649776657800.png
I wrote the rule below to list the "standard" formats but some values don't work.
Can you help me to diagnose the problem?
Can you help me to improve this code?
Thanks in advance.
Comportement correct / Proper behavior :
tristanhaller_3-1649777144667.png
Comportement incohérent / Inconsistent behaviour :
tristanhaller_2-1649777055322.png
' création des 3 Propriétés Custom :
iProperties.Value("Custom", "HtFeuille") = "" ' n'affiche rien si un format"Normé" est reconnu
iProperties.Value("Custom", "LargFeuille") = "" ' n'affiche rien si un format"Normé" est reconnu
iProperties.Value("Custom", "Format") = "\" ' Affiche \ si un format "Normé" N'EST PAS reconnu
' Listes des Format "Normé" a recherché:
' Ax Portrait :
If ActiveSheet.Height = 37 And ActiveSheet.Width = 26 Then iProperties.Value("Custom","Format") = "A10"
If ActiveSheet.Height = 52 And ActiveSheet.Width = 37 Then iProperties.Value("Custom","Format") = "A9"
If ActiveSheet.Height = 74 And ActiveSheet.Width = 52 Then iProperties.Value("Custom","Format") = "A8"
If ActiveSheet.Height = 105 And ActiveSheet.Width = 74 Then iProperties.Value("Custom","Format") = "A7"
If ActiveSheet.Height = 148 And ActiveSheet.Width = 105 Then iProperties.Value("Custom","Format") = "A6"
If ActiveSheet.Height = 210 And ActiveSheet.Width = 148 Then iProperties.Value("Custom","Format") = "A5"
If ActiveSheet.Height = 297 And ActiveSheet.Width = 210 Then iProperties.Value("Custom","Format") = "A4"
If ActiveSheet.Height = 420 And ActiveSheet.Width = 297 Then iProperties.Value("Custom","Format") = "A3"
If ActiveSheet.Height = 594 And ActiveSheet.Width = 420 Then iProperties.Value("Custom","Format") = "A2"
If ActiveSheet.Height = 841 And ActiveSheet.Width = 594 Then iProperties.Value("Custom","Format") = "A1"
If ActiveSheet.Height = 1189 And ActiveSheet.Width = 841 Then iProperties.Value("Custom","Format") = "A0"
' Ax Paysage :
If ActiveSheet.Height = 26 And ActiveSheet.Width = 37 Then iProperties.Value("Custom","Format") = "A10"
If ActiveSheet.Height = 37 And ActiveSheet.Width = 52 Then iProperties.Value("Custom","Format") = "A9"
If ActiveSheet.Height = 52 And ActiveSheet.Width = 74 Then iProperties.Value("Custom","Format") = "A8"
If ActiveSheet.Height = 74 And ActiveSheet.Width = 105 Then iProperties.Value("Custom","Format") = "A7"
If ActiveSheet.Height = 105 And ActiveSheet.Width = 148 Then iProperties.Value("Custom","Format") = "A6"
If ActiveSheet.Height = 148 And ActiveSheet.Width = 210 Then iProperties.Value("Custom","Format") = "A5"
If ActiveSheet.Height = 210 And ActiveSheet.Width = 297 Then iProperties.Value("Custom","Format") = "A4"
If ActiveSheet.Height = 297 And ActiveSheet.Width = 420 Then iProperties.Value("Custom","Format") = "A3"
If ActiveSheet.Height = 420 And ActiveSheet.Width = 594 Then iProperties.Value("Custom","Format") = "A2"
If ActiveSheet.Height = 594 And ActiveSheet.Width = 841 Then iProperties.Value("Custom","Format") = "A1"
If ActiveSheet.Height = 841 And ActiveSheet.Width = 1189 Then iProperties.Value("Custom","Format") = "A0"
' Bx Portrait :
If ActiveSheet.Height = 44 And ActiveSheet.Width = 31 Then iProperties.Value("Custom","Format") = "B10"
If ActiveSheet.Height = 62 And ActiveSheet.Width = 44 Then iProperties.Value("Custom","Format") = "B9"
If ActiveSheet.Height = 88 And ActiveSheet.Width = 62 Then iProperties.Value("Custom","Format") = "B8"
If ActiveSheet.Height = 125 And ActiveSheet.Width = 88 Then iProperties.Value("Custom","Format") = "B7"
If ActiveSheet.Height = 176 And ActiveSheet.Width = 125 Then iProperties.Value("Custom","Format") = "B6"
If ActiveSheet.Height = 250 And ActiveSheet.Width = 176 Then iProperties.Value("Custom","Format") = "B5"
If ActiveSheet.Height = 353 And ActiveSheet.Width = 250 Then iProperties.Value("Custom","Format") = "B4"
If ActiveSheet.Height = 500 And ActiveSheet.Width = 353 Then iProperties.Value("Custom","Format") = "B3"
If ActiveSheet.Height = 707 And ActiveSheet.Width = 500 Then iProperties.Value("Custom","Format") = "B2"
If ActiveSheet.Height = 1000 And ActiveSheet.Width = 707 Then iProperties.Value("Custom","Format") = "B1"
If ActiveSheet.Height = 1414 And ActiveSheet.Width = 1000 Then iProperties.Value("Custom","Format") = "B0"
' Bx Paysage :
If ActiveSheet.Height = 31 And ActiveSheet.Width = 44 Then iProperties.Value("Custom","Format") = "B10"
If ActiveSheet.Height = 44 And ActiveSheet.Width = 62 Then iProperties.Value("Custom","Format") = "B9"
If ActiveSheet.Height = 62 And ActiveSheet.Width = 88 Then iProperties.Value("Custom","Format") = "B8"
If ActiveSheet.Height = 88 And ActiveSheet.Width = 125 Then iProperties.Value("Custom","Format") = "B7"
If ActiveSheet.Height = 125 And ActiveSheet.Width = 176 Then iProperties.Value("Custom","Format") = "B6"
If ActiveSheet.Height = 176 And ActiveSheet.Width = 250 Then iProperties.Value("Custom","Format") = "B5"
If ActiveSheet.Height = 250 And ActiveSheet.Width = 353 Then iProperties.Value("Custom","Format") = "B4"
If ActiveSheet.Height = 353 And ActiveSheet.Width = 500 Then iProperties.Value("Custom","Format") = "B3"
If ActiveSheet.Height = 500 And ActiveSheet.Width = 707 Then iProperties.Value("Custom","Format") = "B2"
If ActiveSheet.Height = 707 And ActiveSheet.Width = 1000 Then iProperties.Value("Custom","Format") = "B1"
If ActiveSheet.Height = 1000 And ActiveSheet.Width = 1414 Then iProperties.Value("Custom","Format") = "B0"
' Cx Portrait :
If ActiveSheet.Height = 40 And ActiveSheet.Width = 28 Then iProperties.Value("Custom","Format") = "C10"
If ActiveSheet.Height = 57 And ActiveSheet.Width = 40 Then iProperties.Value("Custom","Format") = "C9"
If ActiveSheet.Height = 81 And ActiveSheet.Width = 57 Then iProperties.Value("Custom","Format") = "C8"
If ActiveSheet.Height = 114 And ActiveSheet.Width = 81 Then iProperties.Value("Custom","Format") = "C7"
If ActiveSheet.Height = 162 And ActiveSheet.Width = 114 Then iProperties.Value("Custom","Format") = "C6"
If ActiveSheet.Height = 229 And ActiveSheet.Width = 162 Then iProperties.Value("Custom","Format") = "C5"
If ActiveSheet.Height = 324 And ActiveSheet.Width = 229 Then iProperties.Value("Custom","Format") = "C4"
If ActiveSheet.Height = 458 And ActiveSheet.Width = 324 Then iProperties.Value("Custom","Format") = "C3"
If ActiveSheet.Height = 648 And ActiveSheet.Width = 458 Then iProperties.Value("Custom","Format") = "C2"
If ActiveSheet.Height = 917 And ActiveSheet.Width = 648 Then iProperties.Value("Custom","Format") = "C1"
If ActiveSheet.Height = 1297 And ActiveSheet.Width = 917 Then iProperties.Value("Custom","Format") = "C0"
' Cx Paysage :
If ActiveSheet.Height = 28 And ActiveSheet.Width = 40 Then iProperties.Value("Custom","Format") = "C10"
If ActiveSheet.Height = 40 And ActiveSheet.Width = 57 Then iProperties.Value("Custom","Format") = "C9"
If ActiveSheet.Height = 57 And ActiveSheet.Width = 81 Then iProperties.Value("Custom","Format") = "C8"
If ActiveSheet.Height = 81 And ActiveSheet.Width = 114 Then iProperties.Value("Custom","Format") = "C7"
If ActiveSheet.Height = 114 And ActiveSheet.Width = 162 Then iProperties.Value("Custom","Format") = "C6"
If ActiveSheet.Height = 162 And ActiveSheet.Width = 229 Then iProperties.Value("Custom","Format") = "C5"
If ActiveSheet.Height = 229 And ActiveSheet.Width = 324 Then iProperties.Value("Custom","Format") = "C4"
If ActiveSheet.Height = 324 And ActiveSheet.Width = 458 Then iProperties.Value("Custom","Format") = "C3"
If ActiveSheet.Height = 458 And ActiveSheet.Width = 648 Then iProperties.Value("Custom","Format") = "C2"
If ActiveSheet.Height = 648 And ActiveSheet.Width = 917 Then iProperties.Value("Custom","Format") = "C1"
If ActiveSheet.Height = 917 And ActiveSheet.Width = 1297 Then iProperties.Value("Custom","Format") = "C0"
' Si aucun des formats "Normé" n'est reconnu :
If iProperties.Value("Custom", "Format") = "\" Then ' Affiche \ au lieu du Format
iProperties.Value("Custom", "HtFeuille") = ActiveSheet.Height ' Affiche la valeur en mm
iProperties.Value("Custom", "LargFeuille") = ActiveSheet.Width ' Affiche la valeur en mm
End If
Solved! Go to Solution.