Thread: [Solved] Runtime Error 5834 Style?
View Single Post
 
Old 12-09-2016, 04:06 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

The following works fine for me:
Code:
'insert format document titel
    With appWord.Selection
        .TypeText "Aktuelle Kontakte mit " & Format(Date, "Long Date")
        .TypeParagraph
        .MoveLeft Unit:=wdWord, Count:=11, Extend:=wdExtend
        .Font.Size = 14
        .Font.Bold = wdToggle
        .MoveDown Unit:=wdLine, Count:=1
        'insert two column table to hold contact data(one column for contact names, the other for user comments)
        .Tables.Add Range:=.Range, NumRows:=1, NumColumns:=2, DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:=wdAutoFitFixed
        With .Tables(1)
          .Style = "Table Grid"
          .ApplyStyleHeadingRows = True
          .ApplyStyleLastRow = False
          .ApplyStyleFirstColumn = True
          .ApplyStyleLastColumn = False
          .ApplyStyleRowBands = True
          .ApplyStyleColumnBands = False
        End With
    End With
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote