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  

Remove lines after removing table



 
 
Thread Tools Display Modes
  #1  
Old April 2nd, 2010, 10:42 PM posted to microsoft.public.word.tables
accdev
external usenet poster
 
Posts: 16
Default Remove lines after removing table

I'm an amateur with Word vb. In Access 2003 I'm generating the content of a
Word doc that has been set up from a template. There is one table with
current billing charges and another with temporary adjustments. If there are
no adjustments I delete the adjustments table, but I also want to get rid of
the 2 lines (header and detail) that the table took up.
Here is some of the delete code: wrdobj.ActiveDocument.Tables(2).Delete.
How do I get rid of the 2 lines?
Ads
  #2  
Old April 3rd, 2010, 07:17 PM posted to microsoft.public.word.tables
accdev
external usenet poster
 
Posts: 16
Default Remove lines after removing table

I finally did something that worked. I had to play around with the Count
until it did exactly what I wanted. I created a bookmark just above the
table. When there is a table I just delete it.

wrdobj.ActiveDocument.Tables(3).Delete
wrdobj.ActiveDocument.Bookmarks("G2").Select
wrdobj.Selection.Delete Unit:=wdCharacter, Count:=6


"accdev" wrote:

I'm an amateur with Word vb. In Access 2003 I'm generating the content of a
Word doc that has been set up from a template. There is one table with
current billing charges and another with temporary adjustments. If there are
no adjustments I delete the adjustments table, but I also want to get rid of
the 2 lines (header and detail) that the table took up.
Here is some of the delete code: wrdobj.ActiveDocument.Tables(2).Delete.
How do I get rid of the 2 lines?

 




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 09:20 AM.


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