patricktoulon
XLDnaute Barbatruc
tu es sur d'avoir téléchargé la 2.0 D
<PRE indent="-1"><P style="MARGIN: 0px" typ2="modul" typ="vide" indent="0"></P>
<P style="MARGIN: 0px" typ2="modul" typ="vide" indent="0"></P>
<P style="MARGIN: 0px" typ2="modul" typ="autre" indent="0">Option Compare Text</P>
<DIV typ="BlocdieseIf" indent="0"><P style="MARGIN: 0px" typ2="modul" typ="first" indent="0">#If VBA7 Then</P>
<P style="MARGIN: 0px" typ2="modul" typ="autre" indent="1"> Declare PtrSafe Function GetWindowText Lib "user32" Alias "GetWindowTextA" _</P>
<P style="MARGIN: 0px" typ2="modul" typ="autre" indent="1"> (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long</P>
<P style="MARGIN: 0px" typ2="modul" typ="autre" indent="1"> Declare PtrSafe Function EnumWindows Lib "user32" _</P>
<P style="MARGIN: 0px" typ2="modul" typ="autre" indent="1"> (ByVal lpEnumFunc As LongPtr, ByVal Param As Long) As Long</P>
<P style="MARGIN: 0px" typ2="modul" typ="autre" indent="1"> Declare PtrSafe Function IsWindowVisible Lib "user32" _</P>
<P style="MARGIN: 0px" typ2="modul" typ="autre" indent="1"> (ByVal hwnd As Long) As Long</P>
<P style="MARGIN: 0px" typ2="modul" typ="autre" indent="1"> Declare PtrSafe Function EnumDisplayMonitors Lib "user32" _</P>
<P style="MARGIN: 0px" typ2="modul" typ="autre" indent="1"> (ByVal hDC As Long, lprcClip As Any, ByVal lpfnEnum As LongPtr, dwData As Long) As Long</P>
<P style="MARGIN: 0px" typ2="modul" typ="first" indent="0">#Else</P>
<P style="MARGIN: 0px" typ2="modul" typ="autre" indent="1"> Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" _</P>
<P style="MARGIN: 0px" typ2="modul" typ="autre" indent="1"> (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long</P>
<P style="MARGIN: 0px" typ2="modul" typ="autre" indent="1"> Declare Function EnumWindows Lib "user32" _</P>
<P style="MARGIN: 0px" typ2="modul" typ="autre" indent="1"> (ByVal lpEnumFunc As Long, ByVal Param As Long) As Long</P>
<P style="MARGIN: 0px" typ2="modul" typ="autre" indent="1"> Declare Function IsWindowVisible Lib "user32" _</P>
<P style="MARGIN: 0px" typ2="modul" typ="autre" indent="1"> (ByVal hwnd As Long) As Long</P>
<P style="MARGIN: 0px" typ2="modul" typ="autre" indent="1"> Declare Function EnumDisplayMonitors Lib "user32" _</P>
<P style="MARGIN: 0px" typ2="modul" typ="autre" indent="1"> (ByVal hDC As Long, lprcClip As Any, ByVal lpfnEnum As Long, dwData As Long) As Long</P>
<P style="MARGIN: 0px" typ2="modul" typ="first" indent="0">#End If</P></DIV>
<P style="MARGIN: 0px" typ2="modul" typ="Dim" indent="0">Dim Results As Dictionary</P>
<P style="MARGIN: 0px" typ2="modul" typ="Dim" indent="0">Dim Criteria As String</P>
<DIV typ="BlocSub" indent="0"><P style="MARGIN: 0px" typ2="modul" typ="first" indent="0">Sub Msg_Verrue()</P>
<P style="MARGIN: 0px" typ2="modul" typ="autre" indent="1"> UserConfirm _</P>
<P style="MARGIN: 0px" typ2="modul" typ="autre" indent="1"> "Proposition pour le nom du concours du jour : " & _</P>
<P style="MARGIN: 0px" typ2="modul" typ="autre" indent="1"> Format(Now, "DDMMYYYY") & "_" & Environ("COMPUTERNAME"), , _</P>
<P style="MARGIN: 0px" typ2="modul" typ="autre" indent="1"> "vous pouvez faire Ctrl+v (coller)", _</P>
<P style="MARGIN: 0px" typ2="modul" typ="autre" indent="1"> "dans la zone ", _</P>
<P style="MARGIN: 0px" typ2="modul" typ="autre" indent="1"> """Tapez ici le nom de votre nouveau concours""", _</P>
<P style="MARGIN: 0px" typ2="modul" typ="autre" indent="1"> "de Gc_Concours", , _</P>
<P style="MARGIN: 0px" typ2="modul" typ="autre" indent="1"> "OK", "IMG"</P>
<P style="MARGIN: 0px" typ2="modul" typ="vide" indent="0"></P>
<P style="MARGIN: 0px" typ2="modul" typ="first" indent="0">End Sub</P></DIV>
<P style="MARGIN: 0px" typ2="modul" typ="vide" indent="0"></P>
<P style="MARGIN: 0px" typ2="modul" typ="vide" indent="0"></P>
<P style="MARGIN: 0px" typ2="modul" typ="vide" indent="0"></P>
<P style="MARGIN: 0px" typ2="modul" typ="vide" indent="0"></P>
<P style="MARGIN: 0px" typ2="modul" typ="vide" indent="0"></P></PRE>
#If VBA7 Then
Private Declare PtrSafe Function GetWindowText Lib "user32" Alias "GetWindowTextA" _
(ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Declare PtrSafe Function EnumWindows Lib "user32" _
(ByVal lpEnumFunc As LongPtr, ByVal Param As Long) As Long
Private Declare PtrSafe Function IsWindowVisible Lib "user32" _
(ByVal hwnd As Long) As Long
Declare PtrSafe Function EnumDisplayMonitors Lib "user32" _
(ByVal hDC As Long, lprcClip As Any, ByVal lpfnEnum As LongPtr, dwData As Long) As Long
#Else
Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" _
(ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Declare Function EnumWindows Lib "user32" _
(ByVal lpEnumFunc As Long, ByVal Param As Long) As Long
Declare Function IsWindowVisible Lib "user32" _
(ByVal hwnd As Long) As Long
Declare Function EnumDisplayMonitors Lib "user32" _
(ByVal hDC As Long, lprcClip As Any, ByVal lpfnEnum As Long, dwData As Long) As Long
#End If
#If VBA7 Then
Private Declare PtrSafe Function GetWindowText Lib "user32" Alias "GetWindowTextA" _
(ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Declare PtrSafe Function EnumWindows Lib "user32" _
(ByVal lpEnumFunc As LongPtr, ByVal Param As Long) As Long
Private Declare PtrSafe Function IsWindowVisible Lib "user32" _
(ByVal hwnd As Long) As Long
Declare PtrSafe Function EnumDisplayMonitors Lib "user32" _
(ByVal hDC As Long, lprcClip As Any, ByVal lpfnEnum As LongPtr, dwData As Long) As Long
#Else
Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" _
(ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Declare Function EnumWindows Lib "user32" _
(ByVal lpEnumFunc As Long, ByVal Param As Long) As Long
Declare Function IsWindowVisible Lib "user32" _
(ByVal hwnd As Long) As Long
Declare Function EnumDisplayMonitors Lib "user32" _
(ByVal hDC As Long, lprcClip As Any, ByVal lpfnEnum As Long, dwData As Long) As Long
#End If
Ta proposition est de bon aloi,que penserais tu si je fesais un raise sur l'indentation des declare function coupées par un underscore
c'est a dire au lieu de choisir une limite en fonction du texte je formaliserais le truc avec un ecart identique pour toutes
du genre à la place de ca(ici je suis indenté au mot"Function")+l'espace
je fesais ceciVB:#If VBA7 Then Private Declare PtrSafe Function GetWindowText Lib "user32" Alias "GetWindowTextA" _ (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long Declare PtrSafe Function EnumWindows Lib "user32" _ (ByVal lpEnumFunc As LongPtr, ByVal Param As Long) As Long Private Declare PtrSafe Function IsWindowVisible Lib "user32" _ (ByVal hwnd As Long) As Long Declare PtrSafe Function EnumDisplayMonitors Lib "user32" _ (ByVal hDC As Long, lprcClip As Any, ByVal lpfnEnum As LongPtr, dwData As Long) As Long #Else Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" _ (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long Private Declare Function EnumWindows Lib "user32" _ (ByVal lpEnumFunc As Long, ByVal Param As Long) As Long Declare Function IsWindowVisible Lib "user32" _ (ByVal hwnd As Long) As Long Declare Function EnumDisplayMonitors Lib "user32" _ (ByVal hDC As Long, lprcClip As Any, ByVal lpfnEnum As Long, dwData As Long) As Long #End If
qu'en pense tu ?VB:#If VBA7 Then Private Declare PtrSafe Function GetWindowText Lib "user32" Alias "GetWindowTextA" _ (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long Declare PtrSafe Function EnumWindows Lib "user32" _ (ByVal lpEnumFunc As LongPtr, ByVal Param As Long) As Long Private Declare PtrSafe Function IsWindowVisible Lib "user32" _ (ByVal hwnd As Long) As Long Declare PtrSafe Function EnumDisplayMonitors Lib "user32" _ (ByVal hDC As Long, lprcClip As Any, ByVal lpfnEnum As LongPtr, dwData As Long) As Long #Else Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" _ (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long Private Declare Function EnumWindows Lib "user32" _ (ByVal lpEnumFunc As Long, ByVal Param As Long) As Long Declare Function IsWindowVisible Lib "user32" _ (ByVal hwnd As Long) As Long Declare Function EnumDisplayMonitors Lib "user32" _ (ByVal hDC As Long, lprcClip As Any, ByVal lpfnEnum As Long, dwData As Long) As Long #End If
Voilà le Brutre
bonjour et merci @fanch55
c'est le htmlBrut qu'il me faut( l'autre bouton html)
le htmlcolor c'est pas le html produit par le code brut
c'est un arrangement avec coloration syntaxique pour le partage sur forum dans balise enrichi
le html brut lui me donne les blocs réels DIV: p,p,...DIV et le vrai nombre de "&npsp;"
For i = 0 To ps.Length - 1 If i = 3 Then Stop If checkprogression Then barprogress.curs.Width = (260 / ps.Length) * (i + 1): barprogress.Repaint On Error Resume Next SpaC = Application.Rept(" ", Val(ps(i).getattribute("indent"))) Err.Clear: On Error GoTo 0 ps(i).innerhtml = SpaC & ps(i).innerhtml ps(i).Style.margin = 0 SpaC = Application.Rept(" ", Application.Max(plusx, 0)) ps(i).innerhtml = SpaC & ps(i).innerhtml 'pour le report d'indentation des Lignes coupées par le "_" ;calcul du Spac If Right(Trim(ps(i).innertext), 1) = "_" Then If plusx = 0 Then plusx = InStr(Trim(ps(i).innertext), "Declare") - 1 If plusx <= 0 Then plusx = InStr(Trim(ps(i).innertext), Chr(34)) - 1 If plusx <= 0 Then plusx = InStr(Trim(ps(i).innertext), " ") End If Else plusx = 0 End If res2 = res2 & ps(i).outerhtml & vbCrLf ReS = ReS & SpaC & ps(i).innertext & vbCrLf Next | Prenons le ps(2) : "Declare PtrSafe Function GetWindowText Lib "user32" Alias "GetWindowTextA" _" InStr(Trim(ps(i).innertext), "Declare") - 1 ==> Plusx = 0 InStr(Trim(ps(i).innertext), Chr(34)) - 1 ==> Plusx = 43 ( le chr34 étant la double quote devant user32) On passe au ps(3) : "(ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long" Application.Rept(" ", Val(ps(i).getattribute("indent"))) => spac = ( 4 espaces ) ps(i).innerhtml = SpaC & ps(i).innerhtml <= on ajoute 4 espaces devant ps(3) SpaC = Application.Rept(" ", Application.Max(plusx, 0)) <= plusx étant = 43 ps(i).innerhtml = SpaC & ps(i).innerhtml <= on ajoute 43 espaces devant ps(3) ReS = ReS & SpaC & ps(i).innertext & vbCrLf <= le spac n'a pas changé, on rajoute donc 43 espaces devant ps(3) Donc 43 + 43 + 4 = 90 espaces ( ce qui vérifie donc ce qui est présenté dans textbox2 à la première indentation ) |