Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-05-2018, 05:17 AM
Cosmo Cosmo is offline Moving a text range to specific location Windows Vista Moving a text range to specific location Office 2007
Competent Performer
Moving a text range to specific location
 
Join Date: Mar 2012
Posts: 240
Cosmo is on a distinguished road
Default Moving a text range to specific location

I need to move a text range (the text itself, not the range object) to a specific location within a paragraph, and I don't see any way to do so. The 'move' methods are for manipulating the object, not it's content, and the 'relocate' method only seems to move text up or down a paragraph. I didn't see any document methods to do this either.

The current situation I need is to relocate an endnote reference. There are multiple endnotes in this document, and portions of the document which are removed depending on options selected by the user. The endnotes have multiple cross-references to them, so if an endnote is contained within a portion of text which is being removed, I need to move it to the location of the first cross-reference to it, then delete the cross-reference.



Is there a way to take a range (e.g. characters 40-41) and move them to position 126?
Reply With Quote
  #2  
Old 04-05-2018, 09:47 AM
Cosmo Cosmo is offline Moving a text range to specific location Windows Vista Moving a text range to specific location Office 2007
Competent Performer
Moving a text range to specific location
 
Join Date: Mar 2012
Posts: 240
Cosmo is on a distinguished road
Default

I"ve managed to get a working solution for now, instead of moving the endNote, I set the range for the first cross-Reference to the formatted text of the endnote, relink the rest of the cross-References to the new endnote, then delete the original endNote. That does the job, but since there are a LOT of endnotes and cross-References, it takes a bit longer than I'd like.

If there's an easy way to move the endnote (or other range) from one position to another, it would save me this extra time and complication shuffling all of the cross-References.
Reply With Quote
  #3  
Old 04-06-2018, 02:25 AM
slaycock slaycock is offline Moving a text range to specific location Windows 7 64bit Moving a text range to specific location Office 2016
Expert
 
Join Date: Sep 2013
Posts: 256
slaycock is on a distinguished road
Default

You can't 'Move' text as such. You cut/copy and paste. or use one of the insert properties at your destination range, the text or formatted text property from your destination range and then optionally delete at your source range.

Your description of what you wish to do is very confusing but what I think you are saying is that if you are deleting a portion of text that contains the original reference to an endnote then you need to recreate this original reference elsewhere in a portion of text that you are not deleting.

If this understanding is correct then you are probably using the wrong approach by inserting endnotes.

An alternative would be to create a new type of caption

e.g. References.insert Caption.New Label

use 'en' as your new label.

Tick the box exclude label from caption.

You can then create a list of captions that are number 1... n.

If you put the list list of 'en' captions at the end of your document you can now cross refer using the cross reference tool as you did for end notes with the benefit that the source of the cross reference is not embedded in the text and so won't be deleted when a portion of text is deleted.


A further alternative would be to investigate the use of the citations and bibliography tools.
Reply With Quote
  #4  
Old 04-06-2018, 05:40 AM
Cosmo Cosmo is offline Moving a text range to specific location Windows Vista Moving a text range to specific location Office 2007
Competent Performer
Moving a text range to specific location
 
Join Date: Mar 2012
Posts: 240
Cosmo is on a distinguished road
Default

Quote:
Originally Posted by slaycock View Post
You can't 'Move' text as such. You cut/copy and paste. or use one of the insert properties at your destination range, the text or formatted text property from your destination range and then optionally delete at your source range.

Your description of what you wish to do is very confusing but what I think you are saying is that if you are deleting a portion of text that contains the original reference to an endnote then you need to recreate this original reference elsewhere in a portion of text that you are not deleting.

If this understanding is correct then you are probably using the wrong approach by inserting endnotes.

An alternative would be to create a new type of caption

e.g. References.insert Caption.New Label

use 'en' as your new label.

Tick the box exclude label from caption.

You can then create a list of captions that are number 1... n.

If you put the list list of 'en' captions at the end of your document you can now cross refer using the cross reference tool as you did for end notes with the benefit that the source of the cross reference is not embedded in the text and so won't be deleted when a portion of text is deleted.


A further alternative would be to investigate the use of the citations and bibliography tools.
Thanks, I figured there was no way to just move a piece of text. Seems like a simple thing to do (I can drag a selection in the program to relocate text), not sure why that wouldn't be available as a method of the range object.

I'll look into your other suggestions, but I don't know if they will address all of the needs I have. I'm not always very good at phrasing my problem.

If I use captions, then would I need to manage the order of the captions myself if one gets deleted or relocated? e.g. If the first caption is deleted, but is referenced after the third caption in the document, I need the list to reorder to move the first caption to the third location (since it is now referenced later in the document). And if there is only one reference to the caption, then it needs to be deleted from the list.

What I have does seem to work to relocate the endnote and relink the references properly, and will remove or reorder the endnotes as necessary.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving a text range to specific location Save as PDF in specific location with filename using todays date miyoung Word VBA 2 08-15-2017 09:15 AM
Selecting and moving text boxes identified by specific text. Chayes Word VBA 8 02-22-2016 07:01 AM
How to insert text at specific location as bold PRA007 Word VBA 7 01-05-2016 10:12 PM
Moving a text range to specific location Moving formula range multiple cells when moving sum over one cell FraserKitchell Excel 4 02-26-2010 10:38 AM
Create Hyperlinks from Word to specific location in PDF sukanyae Word 0 02-25-2010 04:08 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:39 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft