[Word]Textbox illisible, mais contenu intact!

lml-mike Messages postés 449 Date d'inscription   Statut Contributeur Dernière intervention   -  
lml-mike Messages postés 449 Date d'inscription   Statut Contributeur Dernière intervention   -
Bonjour,

J'ai crée un petit script VBA pour insérer du text dans une textbox, qui se trouve en page 2, à l'aide de word XP.
Quand je scroll vers le bas pour voir le texte une première fois, tout fonctionne niquel.
Mais dès que je réutilise le script une seconde fois, le texte devient totalement illisible :

http://img228.imageshack.us/img228/3748/erreurgz1.jpg

Le plus marrant, c'est quand je copie le texte et le colle autre part...le texte est intact ! (il s'agit donc clairement d'une erreur d'affichage)

J'ai essayé sur d'autres PC avec une version ultérieure de Word (Word 2007), et ça fait exactement la même chose...

Quelqu'un à une idée ?

Merci !!!

2 réponses

  1. m@rina Messages postés 27515 Date d'inscription   Statut Modérateur Dernière intervention   11 562
     
    Bonjour,

    Si tu nous donnais ton code, ce serait quand même mieux ! ;)

    m@rina
    0
    1. lml-mike Messages postés 449 Date d'inscription   Statut Contributeur Dernière intervention   123
       
      ahahah, avec plaisir !

      Private Sub cisco_char_Click()
      
      Dim DNS As String
      Dim IP
      Dim sous_res As String
      Dim lieu As String
      Dim num_crypto As Integer
      Dim i As Integer
      Dim c As String
      Dim rep As String
      
      DNS = InputBox("Entrez le nom DNS du routeur", "Conf. 3200 Industriels", "rtr-sem-fw-indus-")
      If DNS = "" Then
              GoTo Exit_ajout_Click
      End If
      
      UserForm1.Show
      
      If UserForm1.sr251.Value = True Then
      sous_res = "251"
      ElseIf UserForm1.sr252.Value = True Then
      sous_res = "252"
      ElseIf UserForm1.sr253.Value = True Then
      sous_res = "253"
      Else
      GoTo Exit_ajout_Click
      End If
      
      Unload UserForm1
      
      IP = UserForm2.no1.Text
      
      Unload UserForm2
      
      For i = Len(DNS) To 1 Step -1
              If Mid(DNS, i, 1) = "-" Then
                  lieu = c
                  Exit For
              Else
                  c = Mid(DNS, i, 1) & c
              End If
      Next i
      
      lieu = UCase(lieu)
      
      ' lieu : nom de la cryptomap
      rep = MsgBox("Nom du site distant : " & lieu _
      & Chr(13) & Chr(10) & "Nom D.N.S. du routeur : " & DNS _
      & Chr(13) & Chr(10) & "Numéro IP du routeur : " & IP _
      & Chr(13) & Chr(10) & "Sous-réseau du routeur : " & sous_res _
      & Chr(13) & Chr(10), vbOKCancel, "récapitulatif des paramètres de la conf.")
      
      If rep = vbOK Then
      
      num_crypto = Right(CStr(sous_res), 1)
      
      conf1 = "conf t" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" & Chr(13) & Chr(10)
      
      'je vous épargne les 22 autres pavés ^^
      
      conf = conf1 & conf2 & conf3 & conf4 & conf5 & conf6 & conf7 & conf8 & conf9 & conf10 & conf11 & conf12 & conf13 & conf14 & conf15 & conf16 & conf17 & conf18 & conf19 & conf20 & conf21 & conf22 & conf23
      
      
      TextBox3.Locked = False
      TextBox3.Text = conf
      TextBox3.Locked = True
      
      
      conf_sec_mtf = "conf t" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla"
      
      TextBox1.Locked = False
      TextBox1.Text = conf_sec_mtf
      TextBox1.Locked = True
      
      conf_sec_stma = "conf t" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla" _
       & Chr(13) & Chr(10) & "bla"
      
      
      TextBox2.Locked = False
      TextBox2.Text = conf_sec_stma
      TextBox2.Locked = True
      
          MsgBox ("configuration 3200 Industriels générée avec succès !")
          
      Else
          GoTo Exit_ajout_Click
      End If
      
      End
      
      Exit_ajout_Click:
              MsgBox ("Configuration 3200 Industriels annulée par l'utilisateur")
      End Sub
      0
  2. lml-mike Messages postés 449 Date d'inscription   Statut Contributeur Dernière intervention   123
     
    up ! :)
    0