Imprime les commentaires ...

Résolu
CarineVL Messages postés 342 Statut Membre -  
CarineVL Messages postés 342 Statut Membre -
Bonjour,
Dans une macro, j'ai défini la zone d'impression du document mais curieusement le document veut imprimer tous les commentaires repris dans cette zone d'impression ...
Comment lui indiquer de n'imprimer que la zone définie sans les commentaires.
Merci ...
CVL

3 réponses

  1. cs_Le Pivert Messages postés 8437 Statut Contributeur 730
     
    cliquez sur le logo en haut à gauche, Options Excel, Option avancées
    et voir si cela est comme ça:


    0
    1. CarineVL Messages postés 342 Statut Membre 9
       
      Bonjour,
      J'ai bien coché maintanant "indicateur seul et commentaires au survol"
      Merci ...
      J'avais déjà trouvé une solution pour ne pas imprimer les commentaires avec le code suivant:
      ' ne pas imprimer les commentaires
      ActiveSheet.PageSetup.PrintComments = xlPrintNoComments

      Cordialement,
      CVL
      0
  2. cs_Le Pivert Messages postés 8437 Statut Contributeur 730
     
    Bonjour,

    Comme cela:

    Private Sub CommandButton1_Click()
     Application.DisplayCommentIndicator = xlCommentIndicatorOnly 'masquer
    End Sub
    
    Private Sub CommandButton2_Click()
     Application.DisplayCommentIndicator = xlCommentAndIndicator 'afficher
    End Sub
    
    Private Sub CommandButton3_Click()
     Application.DisplayCommentIndicator = xlNoIndicator 'masquer indicateur
    End Sub

    -1
    1. CarineVL Messages postés 342 Statut Membre 9
       
      Bonjour, les commentaires s'impriment toujours.
      Pourtant dans mise en page, feuille :: "aucun" est bien sélectionné !.
      Après la macro, quand j'y retourne , il indique à Commentaires: "A la fin de la feuille"
      J'ai inséré le code à plusieurs endroits mais rien n'y fait ...

      Voici le code en dessous ...

      Merci de me conseiller ...

      Cordialement
      CVL
      :
      Sub imprimer_env_DetailMargesok()
      ' imprimer_enveloppe_détail avec marges gauches et droites à 0
      ' mise à 0 des marges et commentaires aucun

      ' Mettre les marges à 0 dans la nouvelle feuille créée
      Application.PrintCommunication = False
      Application.DisplayCommentIndicator = xlNoIndicator 'masquer indicateur
      With ActiveSheet.PageSetup
      .PrintTitleRows = ""
      .PrintTitleColumns = ""
      End With
      Application.PrintCommunication = True
      ActiveSheet.PageSetup.PrintArea = "$A$3:$G$116"
      Application.PrintCommunication = False
      Application.DisplayCommentIndicator = xlNoIndicator 'masquer indicateur
      With ActiveSheet.PageSetup
      .LeftHeader = ""
      .CenterHeader = ""
      .RightHeader = ""
      .LeftFooter = ""
      .CenterFooter = ""
      .RightFooter = ""
      .LeftMargin = "0" 'Application.InchesToPoints(0)
      .RightMargin = "0" 'Application.InchesToPoints(0)
      .TopMargin = "35" 'Application.InchesToPoints(0.748031496062992)
      .BottomMargin = "35" 'Application.InchesToPoints(0.748031496062992)
      .HeaderMargin = Application.InchesToPoints(0.31496062992126)
      .FooterMargin = Application.InchesToPoints(0.31496062992126)
      .PrintHeadings = False
      .PrintGridlines = False
      .PrintComments = xlPrintNoComments
      .PrintQuality = 600
      .CenterHorizontally = False
      .CenterVertically = False
      .Orientation = xlPortrait
      .Draft = False
      .PaperSize = xlPaperA4
      .FirstPageNumber = xlAutomatic
      .Order = xlDownThenOver
      .BlackAndWhite = False
      .Zoom = 100
      .PrintErrors = xlPrintErrorsDisplayed
      .OddAndEvenPagesHeaderFooter = False
      .DifferentFirstPageHeaderFooter = False
      .ScaleWithDocHeaderFooter = True
      .AlignMarginsHeaderFooter = True
      .EvenPage.LeftHeader.Text = ""
      .EvenPage.CenterHeader.Text = ""
      .EvenPage.RightHeader.Text = ""
      .EvenPage.LeftFooter.Text = ""
      .EvenPage.CenterFooter.Text = ""
      .EvenPage.RightFooter.Text = ""
      .FirstPage.LeftHeader.Text = ""
      .FirstPage.CenterHeader.Text = ""
      .FirstPage.RightHeader.Text = ""
      .FirstPage.LeftFooter.Text = ""
      .FirstPage.CenterFooter.Text = ""
      .FirstPage.RightFooter.Text = ""

      End With
      Application.PrintCommunication = True
      Application.DisplayCommentIndicator = xlNoIndicator 'masquer indicateur

      'Impression de la sélection

      Range("A189:G254").Select
      Application.CutCopyMode = False
      ActiveSheet.PageSetup.PrintArea = "$A$189:$G$254"
      ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
      IgnorePrintAreas:=False
      Range("A3:G116").Select
      Range("H1").Activate
      ActiveSheet.PageSetup.PrintArea = "$A$3:$G$116"
      ActiveWorkbook.Save
      Range("H1").Select
      Application.PrintCommunication = False
      MsgBox "Le document à coller sur l'enveloppe s'imprime avec les marges à zéro."
      End Sub
      0