View Single Post
 
Old 11-12-2015, 01:17 AM
1van 1van is offline Windows 7 64bit Office 2007
Novice
 
Join Date: Nov 2015
Posts: 4
1van is on a distinguished road
Default Apply styles in word table

Hello, I need help with making a macro for repeatedly adding specific styles to parts of the table, to loop trough the document until the text "%string" is found.

So I would need to apply a style, move a few 'tabs', add a new style, move 'tabs', until "%string" is found:

Code:
    Selection.Style = ActiveDocument.Styles("style1")
    Selection.MoveRight Unit:=wdCell
    Selection.MoveRight Unit:=wdCell
    Selection.MoveRight Unit:=wdCell
    Selection.MoveRight Unit:=wdCell
    Selection.MoveRight Unit:=wdCell
    Selection.MoveRight Unit:=wdCell
    Selection.Style = ActiveDocument.Styles("style1")
    Selection.MoveRight Unit:=wdCell
    Selection.MoveRight Unit:=wdCell
    Selection.MoveRight Unit:=wdCell
    Selection.MoveRight Unit:=wdCell
    Selection.MoveRight Unit:=wdCell
    Selection.MoveRight Unit:=wdCell
this is the number of 'tabs' that is required to position over the right part of the table.

Thank you. Ivan.
Reply With Quote