View Single Post
  #11   Report Post  
Posted to microsoft.public.word.newusers
LordHog LordHog is offline
external usenet poster
 
Posts: 5
Default Copying hidden text, possible?

On Jan 8, 2:35*am, "Tony Jollans" My forename at my surname dot com
wrote:
Without going into a lot of detail about how the clipboard works, when you
copy a Word Range (or anything else), it is put on the clipboard in several
formats, some of which may include hidden text, some of which may not. When
you paste from the clipboard, what gets pasted depends upon the application
you are pasting into and the format you use - or it uses.

Text formats (such as might paste into Notepad) do not include hidden text
(that's actually hidden) by default, but can be made to in VBA. The
TextRetrievalMode.IncludeHiddenText property controls this - and this is
probably the option LordHog is looking for; there is no need to use
temporary documents or to change what shows on screen.

If formatted text is being pasted, then what happens to it depends on the
Application; what application is being used?

--
Enjoy,
Tony

*www.WordArticles.com

"Reitanos" wrote in message

...
@Tony: The issue is not selecting the hidden text, it's that Word will
not copy hidden text to the clipboard along with other text (a very
interesting wrinkle I had never noticed before). LH's issue is
selecting a range that contains both hidden and non-hidden text and
copying it. I suggested a macro that copies the selection, creates a
new doc, pastes, unhides everything, copies it all, and then closes
the new doc, but that seems like too many steps to do what sounds like
a simple task. Any ideas?

@LH: try recording a macro to do this. It's pretty simple and macros
can be a lot of fun if you've got any geek in you!

There is a useful command that you cannot record that would help when
closing the other document: "application.displayalerts = false" will
turn off prompts and dialogs. Be sure to set it back to true before
the macro ends.

On Jan 7, 10:14 pm, LordHog wrote:

On Jan 7, 4:01 pm, "Tony Jollans" My forename at my surname dot com
wrote:


You can only select hidden text if it is being displayed. You can define
a
Range in a macro to be anything you want, including hidden text, and do
as
you will with it - no need to change the display in the process at all.


--
Enjoy,
Tony


www.WordArticles.com


"LordHog" wrote in message


....
On Jan 7, 12:55 pm, Reitanos wrote:


This bit of macro assumes that you ONLY have hidden text selected (as
opposed to some hidden and some not hidden), but it will work.


Sub CopyHidden()
Selection.Font.Hidden = False
Selection.Copy
Selection.Font.Hidden = True
End Sub


It's fascinating that Word can paste the text internally while hidden,
but it does not share that with the clipboard - even the Office
Clipboard can paste the hidden text but does not display the text
(although it does paste it in other office apps).


On Jan 7, 2:11 pm, LordHog wrote:


Hello,


Is it possible to select hidden text within MS Word (e.g., Word
2003) and copy hidden text to the clipboard so it may be pasted into
another application? I am looking to avoid having to select the
text,
deselect the hide option the text then re-select the hide option.


Mark


Reitanos,


I do wish there was an option to tell Word to copy any text
regardless if hidden or not. I had thought about this type of macro,
but unfortunately what we are trying to copy contains a mixture of
hidden text, requirement ID, and the remainder of the text
(requirement). As you indicated, this should on be run against text
that was hidden as not to hide text that should not be hidden. A
thought that I had was to take the copied text, paste it into a new
document, unhide (is that really word?) all the text the copy that to
the clipboard. This might work, but I don't want to see Word switching
between documents causing the screen to flicker. Perhaps Word can
create a new document resident within memory and then I could work
from within this document?


Mark


Tony,


If a user selected text with hidden and nonhidden text, how would I
declare a region using that selected text? Once the region is defined
what steps would I need to take to copy the text to the clipboard so
all the text then could be pasted elsewhere?


Mark


Tony,

I will try to create a macro which will perform the feat of coping
both hidden and non-hidden text. There is no single application that
in which the text will be copied to, but typically it would be copying
requirements, with hidden PUI numbers, in other Word documents, e-
mails or source code. It may take me a day or two to get it working,
but if I can get it working I will posted what I was able to
accomplish for other to use. I want to thank both you and Reitanos for
the help and I certainly appreciate the help!!!

Mark