#1   Report Post  
Posted to microsoft.public.word.tables
SoNew2This SoNew2This is offline
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.word.tables
Helmut Weber[_2_] Helmut Weber[_2_] is offline
external usenet poster
 
Posts: 45
Default 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
Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
deleting chic Microsoft Word Help 1 September 10th 07 07:48 PM
What's with not deleting? Shitbiscuit Microsoft Word Help 3 May 31st 07 08:37 AM
Deleting page venus Microsoft Word Help 1 May 22nd 06 09:48 PM
deleting dumb-dumb Microsoft Word Help 1 November 30th 05 06:38 AM
Having trouble deleting Nathalie2973 Microsoft Word Help 3 October 17th 05 08:10 PM


All times are GMT +1. The time now is 09:55 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"