Tu copies ce qui suit dans un module standard.
'---------------------------------------------
Sub test012()
Dim rDcm As Range ' the documents range
Set rDcm = ActiveDocument.Range
Selection.StartOf Unit:=wdStory, Extend:=wdMove
With Selection.Find
.Text = Chr(12)
While .Execute
MsgBox KindofBreak12(Selection.Range)
Wend
End With
'wdSectionContinuous ' 0
'wdSectionNewColumn ' 1
'wdSectionNewPage ' 2
'wdSectionEvenPage ' 3
'wdSectionOddPage '4
End Sub
'---------------------------------------------
Public Function KindofBreak12(ByVal rTmp As Range) As String
Dim lSct1 As Long ' counter for sections
Dim lSct2 As Long ' counter for sections
Dim lKoSc As Long ' kind of section.pagesetup.sectionstart
rTmp.Start = ActiveDocument.Range.Start
lSct1 = rTmp.Sections.Count ' count sections
rTmp.End = rTmp.End + 1 ' extend range
lSct2 = rTmp.Sections.Count ' count sections again
If lSct1 = lSct2 Then ' next caracter is in the same section
KindofBreak12 = "ordinary page break"
Exit Function
End If
' next character is in the next section
lKoSc = ActiveDocument.Sections(lSct2).PageSetup.SectionStart
Select Case lKoSc
Case 0: KindofBreak12 = "wdSectionContinuous"
Case 2: KindofBreak12 = "wdSectionNewPage"
Case 3: KindofBreak12 = "wdSectionEvenPage"
Case 4: KindofBreak12 = "wdSectionOddPage"
End Select
End Function
'---------------------------------------------
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
MiMa
Bonjour michdenis Ton message s'est bien inscrit dans le fil de la discution. Je te remercie pour ces renseignements qui répondent à mes intérrogations. Même si je ne les utilise pas immédiatement, je n'aime pas rester sur une situation en supend. Grace à ton intervention précédente et aux suggestion de Geo, je suis arrivé à bout de mon projet. Merci encore a+ MiMa
"michdenis" a écrit dans le message de news:
3 tentatives effectuées pour diriger cet envoi directement à la suite du fil sans succès !
| Mais il me laisse sur mes interrogations sur la | façon de gérer les sauts.
Tu retrouves le code publié dans ce message à cette adresse sous la plume de Helmut Weber.
Tu copies ce qui suit dans un module standard. '--------------------------------------------- Sub test012() Dim rDcm As Range ' the documents range Set rDcm = ActiveDocument.Range Selection.StartOf Unit:=wdStory, Extend:=wdMove With Selection.Find .Text = Chr(12) While .Execute MsgBox KindofBreak12(Selection.Range) Wend End With 'wdSectionContinuous ' 0 'wdSectionNewColumn ' 1 'wdSectionNewPage ' 2 'wdSectionEvenPage ' 3 'wdSectionOddPage '4
End Sub '--------------------------------------------- Public Function KindofBreak12(ByVal rTmp As Range) As String Dim lSct1 As Long ' counter for sections Dim lSct2 As Long ' counter for sections Dim lKoSc As Long ' kind of section.pagesetup.sectionstart rTmp.Start = ActiveDocument.Range.Start lSct1 = rTmp.Sections.Count ' count sections rTmp.End = rTmp.End + 1 ' extend range lSct2 = rTmp.Sections.Count ' count sections again If lSct1 = lSct2 Then ' next caracter is in the same section KindofBreak12 = "ordinary page break" Exit Function End If ' next character is in the next section lKoSc = ActiveDocument.Sections(lSct2).PageSetup.SectionStart Select Case lKoSc Case 0: KindofBreak12 = "wdSectionContinuous" Case 2: KindofBreak12 = "wdSectionNewPage" Case 3: KindofBreak12 = "wdSectionEvenPage" Case 4: KindofBreak12 = "wdSectionOddPage" End Select
End Function '---------------------------------------------
Bonjour michdenis
Ton message s'est bien inscrit dans le fil de la discution.
Je te remercie pour ces renseignements qui répondent à mes intérrogations.
Même si je ne les utilise pas immédiatement, je n'aime pas rester sur une
situation en supend.
Grace à ton intervention précédente et aux suggestion de Geo, je suis arrivé
à bout de mon projet.
Merci encore
a+
MiMa
"michdenis" <michdenis@hotmail.com> a écrit dans le message de news:
6BE4CD62-1153-4F9E-BFD8-19C81843D9FD@microsoft.com...
3 tentatives effectuées pour diriger cet envoi directement
à la suite du fil sans succès !
| Mais il me laisse sur mes interrogations sur la
| façon de gérer les sauts.
Tu retrouves le code publié dans ce message à
cette adresse sous la plume de Helmut Weber.
Tu copies ce qui suit dans un module standard.
'---------------------------------------------
Sub test012()
Dim rDcm As Range ' the documents range
Set rDcm = ActiveDocument.Range
Selection.StartOf Unit:=wdStory, Extend:=wdMove
With Selection.Find
.Text = Chr(12)
While .Execute
MsgBox KindofBreak12(Selection.Range)
Wend
End With
'wdSectionContinuous ' 0
'wdSectionNewColumn ' 1
'wdSectionNewPage ' 2
'wdSectionEvenPage ' 3
'wdSectionOddPage '4
End Sub
'---------------------------------------------
Public Function KindofBreak12(ByVal rTmp As Range) As String
Dim lSct1 As Long ' counter for sections
Dim lSct2 As Long ' counter for sections
Dim lKoSc As Long ' kind of section.pagesetup.sectionstart
rTmp.Start = ActiveDocument.Range.Start
lSct1 = rTmp.Sections.Count ' count sections
rTmp.End = rTmp.End + 1 ' extend range
lSct2 = rTmp.Sections.Count ' count sections again
If lSct1 = lSct2 Then ' next caracter is in the same section
KindofBreak12 = "ordinary page break"
Exit Function
End If
' next character is in the next section
lKoSc = ActiveDocument.Sections(lSct2).PageSetup.SectionStart
Select Case lKoSc
Case 0: KindofBreak12 = "wdSectionContinuous"
Case 2: KindofBreak12 = "wdSectionNewPage"
Case 3: KindofBreak12 = "wdSectionEvenPage"
Case 4: KindofBreak12 = "wdSectionOddPage"
End Select
End Function
'---------------------------------------------
Bonjour michdenis Ton message s'est bien inscrit dans le fil de la discution. Je te remercie pour ces renseignements qui répondent à mes intérrogations. Même si je ne les utilise pas immédiatement, je n'aime pas rester sur une situation en supend. Grace à ton intervention précédente et aux suggestion de Geo, je suis arrivé à bout de mon projet. Merci encore a+ MiMa
"michdenis" a écrit dans le message de news:
3 tentatives effectuées pour diriger cet envoi directement à la suite du fil sans succès !
| Mais il me laisse sur mes interrogations sur la | façon de gérer les sauts.
Tu retrouves le code publié dans ce message à cette adresse sous la plume de Helmut Weber.
Tu copies ce qui suit dans un module standard. '--------------------------------------------- Sub test012() Dim rDcm As Range ' the documents range Set rDcm = ActiveDocument.Range Selection.StartOf Unit:=wdStory, Extend:=wdMove With Selection.Find .Text = Chr(12) While .Execute MsgBox KindofBreak12(Selection.Range) Wend End With 'wdSectionContinuous ' 0 'wdSectionNewColumn ' 1 'wdSectionNewPage ' 2 'wdSectionEvenPage ' 3 'wdSectionOddPage '4
End Sub '--------------------------------------------- Public Function KindofBreak12(ByVal rTmp As Range) As String Dim lSct1 As Long ' counter for sections Dim lSct2 As Long ' counter for sections Dim lKoSc As Long ' kind of section.pagesetup.sectionstart rTmp.Start = ActiveDocument.Range.Start lSct1 = rTmp.Sections.Count ' count sections rTmp.End = rTmp.End + 1 ' extend range lSct2 = rTmp.Sections.Count ' count sections again If lSct1 = lSct2 Then ' next caracter is in the same section KindofBreak12 = "ordinary page break" Exit Function End If ' next character is in the next section lKoSc = ActiveDocument.Sections(lSct2).PageSetup.SectionStart Select Case lKoSc Case 0: KindofBreak12 = "wdSectionContinuous" Case 2: KindofBreak12 = "wdSectionNewPage" Case 3: KindofBreak12 = "wdSectionEvenPage" Case 4: KindofBreak12 = "wdSectionOddPage" End Select
End Function '---------------------------------------------