Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / October 2005

Tip: Looking for answers? Try searching our database.

inserting text after a table without disturbing adjacent bookmarks/ranges

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alex - 15 Oct 2005 00:04 GMT
Hello people,

Here is a problem that got me scratching my head.

The requirements appear simple:
   Given a range in a document,
   insert some text (say a paragraph mark) after it
   without this text bleeding into adjacent bookmarks and/or ranges).

That is, given:
   [Range1][Range2]
Should result in:
   [Range1]Text[Range2]

(I cannot adjust Range2 after the fact because at the time I may be holding a multitude of ranges that might be affected).

The biggest problem is when the ranges consist of Word tables.

That is:
   [Table1][Range2]
Should result in:
   [Table1]Text[Range2]

Or, alternatively:
   [Range1][Table2]
Should result in:
   [Range1]Text[Table2]

Any ideas?

Best wishes,
Alex.

Signature

Address email to user "response" at domain "alexoren" with suffix "com"

Doug Robbins - 15 Oct 2005 06:55 GMT
How about Range2.Start = Range2.Start + [length of inserted text]

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

Hello people,

Here is a problem that got me scratching my head.

The requirements appear simple:
   Given a range in a document,
   insert some text (say a paragraph mark) after it
   without this text bleeding into adjacent bookmarks and/or ranges).

That is, given:
   [Range1][Range2]
Should result in:
   [Range1]Text[Range2]

(I cannot adjust Range2 after the fact because at the time I may be holding
a multitude of ranges that might be affected).

The biggest problem is when the ranges consist of Word tables.

That is:
   [Table1][Range2]
Should result in:
   [Table1]Text[Range2]

Or, alternatively:
   [Range1][Table2]
Should result in:
   [Range1]Text[Table2]

Any ideas?

Best wishes,
Alex.

Signature

Address email to user "response" at domain "alexoren" with suffix "com"

Alex - 17 Oct 2005 15:49 GMT
Hello Doug,

This is what I am currently doing.

However, this is not an optimal solution since I have to go over *all* the bookmarks (and all the ranges that are currently held) that can possibly be adjacent to my change and check if any of them has to be modified.

Best wishes,
Alex.

> How about Range2.Start = Range2.Start + [length of inserted text]

> Hello people,
>
[quoted text clipped - 26 lines]
>
> Any ideas?

Signature

Address email to user "response" at domain "alexoren" with suffix "com"

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.