Problème VBA pour Word
Fermé
Vash
-
26 juil. 2005 à 21:46
WhiteFang Messages postés 2056 Date d'inscription dimanche 1 septembre 2002 Statut Membre Dernière intervention 15 février 2008 - 8 sept. 2005 à 17:12
WhiteFang Messages postés 2056 Date d'inscription dimanche 1 septembre 2002 Statut Membre Dernière intervention 15 février 2008 - 8 sept. 2005 à 17:12
A voir également:
- Problème VBA pour Word
- Supprimer une page word - Guide
- Espace insécable word - Guide
- Organigramme word - Guide
- Word gratuit - Guide
- Signature électronique word - Guide
1 réponse
il te faut ouvrir d'abord l'entete
'*********************************************************************************
Sub Word_Activer_Entete()
'*********************************************************************************
With Word_Application
If .ActiveWindow.View.SplitSpecial <> wdPaneNone Then
.ActiveWindow.Panes(2).Close
End If
If .ActiveWindow.ActivePane.View.Type = wdNormalView _
Or .ActiveWindow.ActivePane.View.Type = wdOutlineView _
Or .ActiveWindow.ActivePane.View.Type = wdMasterView Then
.ActiveWindow.ActivePane.View.Type = wdPageView
End If
.ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
End With
End Sub
'*********************************************************************************
Public Sub Word_Atteindre_Signet(Optional Nom_signet As Variant)
'*********************************************************************************
If Not IsNull(Nom_signet) Then
Word_Application.selection.Goto What:=wdGoToBookmark, Name:=Nom_signet
End If
End Sub
bon courage
'*********************************************************************************
Sub Word_Activer_Entete()
'*********************************************************************************
With Word_Application
If .ActiveWindow.View.SplitSpecial <> wdPaneNone Then
.ActiveWindow.Panes(2).Close
End If
If .ActiveWindow.ActivePane.View.Type = wdNormalView _
Or .ActiveWindow.ActivePane.View.Type = wdOutlineView _
Or .ActiveWindow.ActivePane.View.Type = wdMasterView Then
.ActiveWindow.ActivePane.View.Type = wdPageView
End If
.ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
End With
End Sub
'*********************************************************************************
Public Sub Word_Atteindre_Signet(Optional Nom_signet As Variant)
'*********************************************************************************
If Not IsNull(Nom_signet) Then
Word_Application.selection.Goto What:=wdGoToBookmark, Name:=Nom_signet
End If
End Sub
bon courage
8 sept. 2005 à 17:12
Joli ! Mais tu aurais pu gagner des lignes avec une variable objet et sans le With ;-) Sinon, pas mal, rare de voir ça ! ;-)