Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1413 connectés 

  FORUM HardWare.fr
  Windows & Software
  Logiciels

  [word] réorganiser l'ordre des pages

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

[word] réorganiser l'ordre des pages

n°2420614
niouh
Posté le 26-05-2006 à 20:08:40  profilanswer
 

Bonjour,
 
Comment faire, sous Word, pour réorganiser l'ordre des pages (par exemple, inverser une page avec une autre)?
 
Merci d'avance.

mood
Publicité
Posté le 26-05-2006 à 20:08:40  profilanswer
 

n°2437799
TAM136
Posté le 14-06-2006 à 17:48:46  profilanswer
 

Salut,
 
J'ai un truc tiré de là
 
http://www.vbfrance.com/codes/AFFI [...] 18737.aspx
 
Le principe est d'abord de sélectionner chacune des pages et de les permuter. J'ai donc créé à partir de là plusieurs macros à lancer successivement. A priori, c'est un peu lourd mais ça marche à peu près très bien. Visiblement, le sujet n'a pas l'air d'inspirer grand monde.
 
S'il y avait des sections, peut-être que ce serait plus simple mais honnêtement je n'en sais rien.
 
1/
Sub SélectionPage()
 
Dim Message, Title, Default, NumPageSelection
Message = "Tapper le numéro de la page à afficher:"
Title = "Sélectionner page."
Default = "1"
NumPageSelection = InputBox(Message, Title, Default)
ActiveDocument.Range.Select
Selection.GoTo What:=wdGoToPage, Which:=wdGoToAbsolute, _
Count:=NumPageSelection + 1
Selection.Move Unit:=wdCharacter, Count:=-1
nbligne = Selection.Information(wdFirstCharacterLineNumber)
Selection.Move Unit:=wdCharacter, Count:=1
With Selection
.HomeKey Unit:=wdLine, Extend:=wdMove
.ExtendMode = True
.MoveUp Unit:=wdLine, Count:=nbligne
.ExtendMode = False
End With
End Sub
 
2/Taper 4 par ex et OK
 
3/Sub Macro2()
 
    Selection.Cut
    Dim Message, Title, Default, NumPageSelection
    Message = "Tapper le numéro de la page à afficher:"
    Title = "Sélectionner page."
    Default = "1"
    NumPageSelection = InputBox(Message, Title, Default)
    ActiveDocument.Range.Select
    Selection.GoTo What:=wdGoToPage, Which:=wdGoToAbsolute, _
                            Count:=NumPageSelection + 1
   Selection.Move Unit:=wdCharacter, Count:=-1
   nbligne = Selection.Information(wdFirstCharacterLineNumber)
   Selection.Move Unit:=wdCharacter, Count:=1
   With Selection
       .HomeKey Unit:=wdLine, Extend:=wdMove
       .ExtendMode = True
       .MoveUp Unit:=wdLine, Count:=nbligne
       .ExtendMode = False
   End With
End Sub
 
4/Taper 13 par ex et OK
 
5/Sub Macro3()
 
Selection.MoveUp Unit:=wdLine, Count:=1
Selection.TypeParagraph
Selection.PasteAndFormat (wdPasteDefault)
Dim Message, Title, Default, NumPageSelection
Message = "Tapper le numéro de la page à afficher:"
Title = "Sélectionner page."
Default = "1"
NumPageSelection = InputBox(Message, Title, Default)
ActiveDocument.Range.Select
Selection.GoTo What:=wdGoToPage, Which:=wdGoToAbsolute, _
Count:=NumPageSelection + 1
Selection.Move Unit:=wdCharacter, Count:=-1
nbligne = Selection.Information(wdFirstCharacterLineNumber)
Selection.Move Unit:=wdCharacter, Count:=1
With Selection
.HomeKey Unit:=wdLine, Extend:=wdMove
.ExtendMode = True
.MoveUp Unit:=wdLine, Count:=nbligne
.ExtendMode = False
End With
End Sub
 
6/Taper 12 (page 13-1)
 
7/Sub Macro4()
 
Selection.Cut
Dim Message, Title, Default, NumPageSelection
Message = "Tapper le numéro de la page à afficher:"
Title = "Sélectionner page."
Default = "1"
NumPageSelection = InputBox(Message, Title, Default)
ActiveDocument.Range.Select
Selection.GoTo What:=wdGoToPage, Which:=wdGoToAbsolute, _
Count:=NumPageSelection + 1
Selection.Move Unit:=wdCharacter, Count:=-1
nbligne = Selection.Information(wdFirstCharacterLineNumber)
Selection.Move Unit:=wdCharacter, Count:=1
With Selection
.HomeKey Unit:=wdLine, Extend:=wdMove
.ExtendMode = True
.MoveUp Unit:=wdLine, Count:=nbligne
.ExtendMode = False
End With
End Sub
 
8/Taper 4 et OK
 
9/Sub Macro5()
Selection.MoveUp Unit:=wdLine, Count:=1
Selection.TypeParagraph
Selection.PasteAndFormat (wdPasteDefault)
End Sub

n°2440851
TAM136
Posté le 17-06-2006 à 22:01:03  profilanswer
 

Bonsoir
 
Si ton document comporte des sections
 
http://www.vbfrance.com/recherche. [...] n&tr=forum
 
Sub Macroechangersection1et4()
Selection.GoTo What:=wdGoToSection, Which:=wdGoToFirst, Count:=4, Name:=""
'Count:= n° de la section à sélectionner
Selection.MoveEnd wdSection, 1
Selection.Cut
Selection.HomeKey Unit:=wdStory
Selection.TypeParagraph
Selection.PasteAndFormat (wdPasteDefault)
Selection.GoTo What:=wdGoToSection, Which:=wdGoToFirst, Count:=2, Name:=""
'Count:= n° de la section à sélectionner
Selection.MoveEnd wdSection, 1
Selection.Cut
Selection.GoTo What:=wdGoToSection, Which:=wdGoToFirst, Count:=4, Name:=""
'Count:= n° de la section à sélectionner
Selection.MoveEnd wdSection, 1
    Selection.MoveUp Unit:=wdLine, Count:=1
    Selection.MoveDown Unit:=wdLine, Count:=1
    Selection.TypeParagraph
    Selection.MoveUp Unit:=wdLine, Count:=1
    Selection.PasteAndFormat (wdPasteDefault)
End Sub


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Windows & Software
  Logiciels

  [word] réorganiser l'ordre des pages

 

Sujets relatifs
[Word] image fixe[Word 2003] Question bête
Clic droit qui marche plus sur les pages webProblème avec Word 2003
impossible enregistrer ou ouvrir fichier sous word 2002Outlook 2003: impossible acces pages web!? Help plz!
probleme wordproblème antidote sur word 2003
Une anomalie Word / Windows ...Doublons sur Word
Plus de sujets relatifs à : [word] réorganiser l'ordre des pages


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR