View Single Post
 
Old 08-14-2014, 12:50 AM
Tommes93 Tommes93 is offline Windows 7 64bit Office 2007
Novice
 
Join Date: Mar 2014
Posts: 9
Tommes93 is on a distinguished road
Default

thank you for your code.
the code i posted is just a part of my whole code.
my code is as almost finished and works fine for the tables.
its just the problem with formatting.
your code works fine until this point:
Code:
  Do While .Find.Found
    .Text = "<strong>" & .Text & "</strong>"
    .Font.Bold = False
    .Collapse wdCollapseEnd
    .Find.Execute
  Loop
when the do while loop starts, it wont do it for only one cell or only the table. it goes through the whole document and changes every bold word. but it should do only one cell or a range i set.

at one point i set a range with this code
Code:
Do Until Selection.Style Like "Überschrift*" = True
                Selection.MoveDown Unit:=wdParagraph, count:=1
            Loop
            ende = Selection.End
            Set bereich = ActiveDocument.Range(anfang, ende)
or the code for the cells
Code:
For Each wdCell In ActiveDocument.Tables(ThisTableNumber + 1).Range.Cells

    Set Rng1 = wdCell.Range
    Rng1.End = Rng1.End - 1
    If Rng1.ListFormat.ListType = 3 Then
        If Steps = False Then
            TestcaseString = TestcaseString & "<steps>" & vbCrLf
            Steps = True
        End If
        
        Set Rng2 = wdCell.Next.Range
now the code you posted should change only this range.
Reply With Quote