Jump to content
Sign in to follow this  
avogt3001

per VBA Tabellenfarbe in Word-Kopfzeile ändern

Recommended Posts

Hallo,

wie kann ich per VBA Macro im Word eine Tabellenfarbe (Hintergrund) in der Kopfzeile ändern, jegliche Versuche schlugen hier bisher fehl..

Danke,

Andreas Vogt

 

Share this post


Link to post
Share on other sites
Gerade eben schrieb Sunny61:

Was alles hast Du denn schon versucht? Zeig doch mal den Code, der nicht funktioniert.

'Header weiss färben
            ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
            Dim aTable As Table
            Dim oHF As HeaderFooter
            Set oHF = ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary)
            
            Set aTable = oHF.Range.Tables.Add(Range:= _
            oHF.Range, NumRows:=1, NumColumns:= _
            2, DefaultTableBehavior:=wdWord9TableBehavior, _
            AutoFitBehavior:=wdAutoFitWindow)
            
            With aTable
            .Borders(wdBorderLeft).LineStyle = wdLineStyleNone
            .Borders(wdBorderRight).LineStyle = wdLineStyleNone
            .Borders(wdBorderTop).LineStyle = wdLineStyleNone
            .Borders(wdBorderBottom).LineStyle = wdLineStyleNone
            .Borders(wdBorderVertical).LineStyle = wdLineStyleNone
            .Borders(wdBorderDiagonalDown).LineStyle = wdLineStyleNone
            .Borders(wdBorderDiagonalUp).LineStyle = wdLineStyleNone
            .Borders.Shadow = False
            .Shading.BackgroundPatternColor = wdColorBlue
            .Shading.ForegroundPatternColor = wdColorBlueGray
            .Shading.BackgroundPatternColorIndex = wdBlack
            End With

            


          ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument

Share this post


Link to post
Share on other sites
Der letzte Beitrag zu diesem Thema ist mehr als 180 Tage alt. Bitte überlege Dir, ob es nicht sinnvoller ist ein neues Thema zu erstellen.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

Werbepartner:



×
×
  • Create New...