If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Deleting cr
With assistance from this posting board, I've been able to delete a table if
a certain cell is empty. Dim oRng1 As Range With ActiveDocument Set oRng1 = .Range(Start:=.Bookmarks("BK_COLLS").Range.End, _ End:=.Bookmarks("BK_COLLE").Range.Start) If Len(oRng1.Tables(1).Cell(2, 1).Range) = 2 Then oRng1.Tables(1).Delete GoTo lma Else Dim t1 As Table Set t1 = ActiveDocument.Bookmarks("BK_COLL").Range.Tables(1 ) End If End With This works swell. But I'd like to also delete the first and last carriage returns which are the Start and End Bookmarks. How is this accomplished? Thank you in advance. |
#2
|
|||
|
|||
Deleting cr
Hi,
i'm not sure, if I understand your question right, but for the first character in a bookmark's range: ActiveDocument.Bookmarks("Test").Range.Characters. First = "" For the last character respectively: ActiveDocument.Bookmarks("Test").Range.Characters. Last = "" You could also delete those characters, but sometimes autocorrect settings redo deleting immediately. -- Greetings from Bavaria, Germany Helmut Weber, MVP WordVBA Vista Small Business, Office XP |
Thread Tools | |
Display Modes | |
|
|