A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Tables
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Deleting cr



 
 
Thread Tools Display Modes
  #1  
Old October 30th, 2008, 03:53 PM posted to microsoft.public.word.tables
SoNew2This
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  
Old October 31st, 2008, 01:03 PM posted to microsoft.public.word.tables
Helmut Weber[_2_]
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
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:57 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.