[Word]Textbox illisible, mais contenu intact!

Fermé
lml-mike Messages postés 453 Date d'inscription vendredi 16 février 2007 Statut Contributeur Dernière intervention 18 novembre 2018 - 30 mai 2008 à 16:05
lml-mike Messages postés 453 Date d'inscription vendredi 16 février 2007 Statut Contributeur Dernière intervention 18 novembre 2018 - 3 juin 2008 à 12:08
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 !!!
A voir également:

2 réponses

m@rina Messages postés 20074 Date d'inscription mardi 12 juin 2007 Statut Contributeur Dernière intervention 25 avril 2024 11 271
30 mai 2008 à 16:41
Bonjour,

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

m@rina
0
lml-mike Messages postés 453 Date d'inscription vendredi 16 février 2007 Statut Contributeur Dernière intervention 18 novembre 2018 120
2 juin 2008 à 16:15
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
lml-mike Messages postés 453 Date d'inscription vendredi 16 février 2007 Statut Contributeur Dernière intervention 18 novembre 2018 120
3 juin 2008 à 12:08
up ! :)
0