En fait...je souhaite que le texte "nomdustyle" s'insère dans le texte meme. Je ne sais comment si je me fais bien comprendre
Cette fois : oui :-) Il va falloir que tu précises en quelle version tu es, car il me semble que c'est possible avec une version récente. Sinon on te sortira une macro pas superfétatoire pour ça.
--
A+
Bonjour jb
Merci
En fait...je souhaite que le texte "nomdustyle" s'insère dans le texte
meme.
Je ne sais comment si je me fais bien comprendre
Cette fois : oui :-)
Il va falloir que tu précises en quelle version tu es, car il me semble que
c'est possible avec une version récente.
Sinon on te sortira une macro pas superfétatoire pour ça.
En fait...je souhaite que le texte "nomdustyle" s'insère dans le texte meme. Je ne sais comment si je me fais bien comprendre
Cette fois : oui :-) Il va falloir que tu précises en quelle version tu es, car il me semble que c'est possible avec une version récente. Sinon on te sortira une macro pas superfétatoire pour ça.
--
A+
JB Robert
windows 98 et Ms Office 97
oui je sais, ça date. vous me dites qu'une solution serait possible ! ouffffff. Merci
Bonjour jb
Merci
En fait...je souhaite que le texte "nomdustyle" s'insère dans le texte meme. Je ne sais comment si je me fais bien comprendre
Cette fois : oui :-) Il va falloir que tu précises en quelle version tu es, car il me semble que c'est possible avec une version récente. Sinon on te sortira une macro pas superfétatoire pour ça.
-- JB
http://www.sri.ucl.ac.be/SRI/frfc/rfc1855.fr.html
windows 98 et Ms Office 97
oui je sais, ça date.
vous me dites qu'une solution serait possible !
ouffffff. Merci
Bonjour jb
Merci
En fait...je souhaite que le texte "nomdustyle" s'insère dans le texte
meme.
Je ne sais comment si je me fais bien comprendre
Cette fois : oui :-)
Il va falloir que tu précises en quelle version tu es, car il me semble que
c'est possible avec une version récente.
Sinon on te sortira une macro pas superfétatoire pour ça.
oui je sais, ça date. vous me dites qu'une solution serait possible ! ouffffff. Merci
Bonjour jb
Merci
En fait...je souhaite que le texte "nomdustyle" s'insère dans le texte meme. Je ne sais comment si je me fais bien comprendre
Cette fois : oui :-) Il va falloir que tu précises en quelle version tu es, car il me semble que c'est possible avec une version récente. Sinon on te sortira une macro pas superfétatoire pour ça.
-- JB
http://www.sri.ucl.ac.be/SRI/frfc/rfc1855.fr.html
JB Robert
Geo a formulé la demande :
Sinon on te sortira une macro pas superfétatoire pour ça.
Bonjour,
Je n'arrive pas à voir où est stocké la valeur du stle du paragraphe : quel objet faut il interroger?
-- JB
http://www.sri.ucl.ac.be/SRI/frfc/rfc1855.fr.html
Geo a formulé la demande :
Sinon on te sortira une macro pas superfétatoire pour ça.
Bonjour,
Je n'arrive pas à voir où est stocké la valeur du stle du paragraphe :
quel objet faut il interroger?
Sinon on te sortira une macro pas superfétatoire pour ça.
Bonjour,
Je n'arrive pas à voir où est stocké la valeur du stle du paragraphe : quel objet faut il interroger?
-- JB
http://www.sri.ucl.ac.be/SRI/frfc/rfc1855.fr.html
Geo
Bonjour JB Robert
Geo a formulé la demande :
Sinon on te sortira une macro pas superfétatoire pour ça.
Bonjour,
Je n'arrive pas à voir où est stocké la valeur du stle du paragraphe : quel objet faut il interroger?
Voici trois macros qui marchent en word 2000, j'espère qu'elles fonctionnent en W97. Elles ont trois rôles différents, à adapter sans doute
Attention aux retours à la ligne ajoutés par le lecteur de forums. Bon courage
Sub AjouteNomStyle() ' Crée une zone de texte dans la marge avec le nom du style Dim StyleCourant As String Dim StylePrecedent As String Dim P As Paragraph Dim myTBox As Shape Dim Marge As Long StylePrecedent = "" StyleCourant = "" Dim i As Long
i = 0 For Each P In ActiveDocument.Paragraphs
StyleCourant = P.Style If StyleCourant <> StylePrecedent Then P.Range.Select ' Selection.Collapse Direction:=wdCollapseStart Marge = Selection.PageSetup.LeftMargin - MargeImprimante Set myTBox = ActiveDocument.Shapes _ .AddTextbox(Orientation:=msoTextOrientationHorizontal, _ Left:=-Marge, Top:=0, Width:=LargeurZ, _ Height: , Anchor:=Selection.Range) With myTBox.TextFrame .TextRange = StyleCourant .TextRange.ParagraphFormat.Alignment = wdAlignParagraphCenter .TextRange.ParagraphFormat.SpaceAfter = 0 .TextRange.ParagraphFormat.SpaceBefore = 0 .TextRange.Italic = True .TextRange.Bold = True .TextRange.Font.Size = 8 End With ' ajustement de la zône myTBox.Height = myTBox.TextFrame.TextRange.Font.Size * 2
myTBox.name = Pfx & i i = i + 1 StylePrecedent = StyleCourant End If Next P
End Sub
Public Sub CommenterStyles()
Dim P As Paragraph Dim Debut As Range Dim LeStyle As String Dim PrecStyle As String For Each P In ActiveDocument.Paragraphs Set Debut = P.Range Debut.Collapse Direction:=wdCollapseStart LeStyle = P.Style If LeStyle <> PrecStyle Then ActiveDocument.Comments.Add Range:Þbut, Text:=LeStyle PrecStyle = LeStyle End If Next P End Sub
Sub AjouteNomStyleDansTexte() ' Il faudrait sauter les tableaux Dim StyleCourant As String Dim StylePrecedent As String Dim NbPar As Long Dim i As Long
StylePrecedent = "" StyleCourant = ""
NbPar = ActiveDocument.Paragraphs.Count i = 1
Do StyleCourant = ActiveDocument.Paragraphs(i).Style If StyleCourant = StylePrecedent Then i = i + 1 Else ActiveDocument.Paragraphs(i).Range.Select Selection.Collapse Direction:=wdCollapseStart Selection.InsertAfter "[" & StyleCourant & "]" & Chr(13) Selection.Style = "NomStyle" i = i + 2 StylePrecedent = StyleCourant End If NbPar = ActiveDocument.Paragraphs.Count If i > NbPar Then Exit Do
Loop
End Sub
Bonjour JB Robert
Geo a formulé la demande :
Sinon on te sortira une macro pas superfétatoire pour ça.
Bonjour,
Je n'arrive pas à voir où est stocké la valeur du stle du paragraphe :
quel objet faut il interroger?
Voici trois macros qui marchent en word 2000, j'espère qu'elles
fonctionnent en W97.
Elles ont trois rôles différents, à adapter sans doute
Attention aux retours à la ligne ajoutés par le lecteur de forums.
Bon courage
Sub AjouteNomStyle()
' Crée une zone de texte dans la marge avec le nom du style
Dim StyleCourant As String
Dim StylePrecedent As String
Dim P As Paragraph
Dim myTBox As Shape
Dim Marge As Long
StylePrecedent = ""
StyleCourant = ""
Dim i As Long
i = 0
For Each P In ActiveDocument.Paragraphs
StyleCourant = P.Style
If StyleCourant <> StylePrecedent Then
P.Range.Select
' Selection.Collapse Direction:=wdCollapseStart
Marge = Selection.PageSetup.LeftMargin - MargeImprimante
Set myTBox = ActiveDocument.Shapes _
.AddTextbox(Orientation:=msoTextOrientationHorizontal, _
Left:=-Marge, Top:=0, Width:=LargeurZ, _
Height: , Anchor:=Selection.Range)
With myTBox.TextFrame
.TextRange = StyleCourant
.TextRange.ParagraphFormat.Alignment = wdAlignParagraphCenter
.TextRange.ParagraphFormat.SpaceAfter = 0
.TextRange.ParagraphFormat.SpaceBefore = 0
.TextRange.Italic = True
.TextRange.Bold = True
.TextRange.Font.Size = 8
End With
' ajustement de la zône
myTBox.Height = myTBox.TextFrame.TextRange.Font.Size * 2
myTBox.name = Pfx & i
i = i + 1
StylePrecedent = StyleCourant
End If
Next P
End Sub
Public Sub CommenterStyles()
Dim P As Paragraph
Dim Debut As Range
Dim LeStyle As String
Dim PrecStyle As String
For Each P In ActiveDocument.Paragraphs
Set Debut = P.Range
Debut.Collapse Direction:=wdCollapseStart
LeStyle = P.Style
If LeStyle <> PrecStyle Then
ActiveDocument.Comments.Add Range:Þbut, Text:=LeStyle
PrecStyle = LeStyle
End If
Next P
End Sub
Sub AjouteNomStyleDansTexte()
' Il faudrait sauter les tableaux
Dim StyleCourant As String
Dim StylePrecedent As String
Dim NbPar As Long
Dim i As Long
StylePrecedent = ""
StyleCourant = ""
NbPar = ActiveDocument.Paragraphs.Count
i = 1
Do
StyleCourant = ActiveDocument.Paragraphs(i).Style
If StyleCourant = StylePrecedent Then
i = i + 1
Else
ActiveDocument.Paragraphs(i).Range.Select
Selection.Collapse Direction:=wdCollapseStart
Selection.InsertAfter "[" & StyleCourant & "]" & Chr(13)
Selection.Style = "NomStyle"
i = i + 2
StylePrecedent = StyleCourant
End If
NbPar = ActiveDocument.Paragraphs.Count
If i > NbPar Then Exit Do
Sinon on te sortira une macro pas superfétatoire pour ça.
Bonjour,
Je n'arrive pas à voir où est stocké la valeur du stle du paragraphe : quel objet faut il interroger?
Voici trois macros qui marchent en word 2000, j'espère qu'elles fonctionnent en W97. Elles ont trois rôles différents, à adapter sans doute
Attention aux retours à la ligne ajoutés par le lecteur de forums. Bon courage
Sub AjouteNomStyle() ' Crée une zone de texte dans la marge avec le nom du style Dim StyleCourant As String Dim StylePrecedent As String Dim P As Paragraph Dim myTBox As Shape Dim Marge As Long StylePrecedent = "" StyleCourant = "" Dim i As Long
i = 0 For Each P In ActiveDocument.Paragraphs
StyleCourant = P.Style If StyleCourant <> StylePrecedent Then P.Range.Select ' Selection.Collapse Direction:=wdCollapseStart Marge = Selection.PageSetup.LeftMargin - MargeImprimante Set myTBox = ActiveDocument.Shapes _ .AddTextbox(Orientation:=msoTextOrientationHorizontal, _ Left:=-Marge, Top:=0, Width:=LargeurZ, _ Height: , Anchor:=Selection.Range) With myTBox.TextFrame .TextRange = StyleCourant .TextRange.ParagraphFormat.Alignment = wdAlignParagraphCenter .TextRange.ParagraphFormat.SpaceAfter = 0 .TextRange.ParagraphFormat.SpaceBefore = 0 .TextRange.Italic = True .TextRange.Bold = True .TextRange.Font.Size = 8 End With ' ajustement de la zône myTBox.Height = myTBox.TextFrame.TextRange.Font.Size * 2
myTBox.name = Pfx & i i = i + 1 StylePrecedent = StyleCourant End If Next P
End Sub
Public Sub CommenterStyles()
Dim P As Paragraph Dim Debut As Range Dim LeStyle As String Dim PrecStyle As String For Each P In ActiveDocument.Paragraphs Set Debut = P.Range Debut.Collapse Direction:=wdCollapseStart LeStyle = P.Style If LeStyle <> PrecStyle Then ActiveDocument.Comments.Add Range:Þbut, Text:=LeStyle PrecStyle = LeStyle End If Next P End Sub
Sub AjouteNomStyleDansTexte() ' Il faudrait sauter les tableaux Dim StyleCourant As String Dim StylePrecedent As String Dim NbPar As Long Dim i As Long
StylePrecedent = "" StyleCourant = ""
NbPar = ActiveDocument.Paragraphs.Count i = 1
Do StyleCourant = ActiveDocument.Paragraphs(i).Style If StyleCourant = StylePrecedent Then i = i + 1 Else ActiveDocument.Paragraphs(i).Range.Select Selection.Collapse Direction:=wdCollapseStart Selection.InsertAfter "[" & StyleCourant & "]" & Chr(13) Selection.Style = "NomStyle" i = i + 2 StylePrecedent = StyleCourant End If NbPar = ActiveDocument.Paragraphs.Count If i > NbPar Then Exit Do