Clipboard - paste items on separate lines

curious
3StarLounger
Posts: 331
Joined: 25 Jan 2010, 17:36

Clipboard - paste items on separate lines

Post by curious »

Rather than have multiple clipboard entries pasted all together, is there a way to have them on separate lines? Perhaps a macro? Thank you

User avatar
HansV
Administrator
Posts: 79447
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Clipboard - paste items on separate lines

Post by HansV »

The only way that I know of is to include a line break or paragraph break at the end of every piece of text that you copy to the Office Clipboard.
When you click Paste All, those line or paragraph breaks will be pasted too.

Unfortunately, there is no support for manipulating the Office Clipboard in VBA, so a macro won't help.
Best wishes,
Hans

User avatar
DocAElstein
5StarLounger
Posts: 656
Joined: 18 Jan 2022, 15:59
Location: Re-routing rivers, in Hof, Beautiful Bavaria

Re: Clipboard - paste items on separate lines

Post by DocAElstein »

HansV wrote:
26 May 2023, 07:32
Unfortunately, there is no support for manipulating the Office Clipboard in VBA, so a macro won't help.
Hi,
Potentially there may be a way to do that, or rather something along those lines, maybe not with simple standard VBA stuff, but perhaps with API stuff in VBA. (I don’t know if that counts as in VBA. It’s using VBA to do it, but whether coding using it is regarded as VBA or in VBA or with VBA, etc. is probably a definition you change to suit as you please ..)

Anyways….
We had an enlightening thread where amongst other things we found out that there is no Office Clipboard.
In fact, if I understand correctly ( but that's not always a safe Bet, Lol :-) :smile: ), in terms of Microsoft things, we only have one clipboard, which we might call the (Windows) Clipboard
Apparently what the so called office clipboard is, is one of a few things that monitors what would be put in the (Windows) Clipboard just before you paste, - apparently most, or many things, which we think is in the clipboard will be on some list of things to be put in at the requested time of pasting. (Some technical name of deferred entry)
In this respect the so called Excel clipboard and so called office clipboard have some similarities. But the Office Clipboard is a bit smarter. Whilst monitoring what was/ is intended for the (Windows) Clipboard, it does make it's own copy in various forms of various things, and/or a specific view of it***. These are limited in format: It does not make the super multi version format copy that the real one and only (Windows) Clipboard does, (or would if it ever got to, since the entry may likely be deferred , like a sort of deferred entry).

So, … Now having said all that,
an old, potentially very interesting link
, was suggested,
where it looked as thought we can get at those limited format copies in the so called Office Clipboard and possibly do what is wanted here.

Unfortunately some of the further links there at that old benf link were broken , and anyway I could not make any sense of it. Someone smarter might be able to.

(Before I get banned for talking a lot of made up dribble again, let me say that someone else enlightened us about all this. But to protect the innocent, I am not going to say it was SpeakEasy, .. oops

( I have a gut feeling that the formats of these copies made by the so called office clipboard are often quite adequate to make very good reproductions in Word, so potentially we may have a good solution possibility, although in some initial experiments I did get sometime strange inconstant results in the format that was actually put into Word, on selection from the list of the Office clipboard***. - I suppose this slightly spaghetti type wiring that is the clipboard with its various prioritised list of what and when gets actually put in the (Windows) Clipboard might mean that by chance you might be using the (Windows) Clipboard once in a while when you were actually thinking you were using the Office clipboards copy )

Alan

_.____________________________________________________________________________________________________________________________

Edit PS. We have done some very limited manipulating of the Office Clipboard, in/ with VBA, ( It was a few years back when we still all thought there was an Office clipboard, - silly us! ) . It was using API stuff and we effectively cleared the Office clipboard, by effectively doing what a button does when you click it manually
http://www.eileenslounge.com/viewtopic. ... 84#p246884
http://www.eileenslounge.com/viewtopic. ... 70#p246770
http://www.eileenslounge.com/viewtopic. ... 38#p246838

(Interesting as I remember, the thread was left unanswered, or at least not fully answered. We could not get the thing to work in Excel 2016 +
I wonder if some of our recent discussions here might help finally get that answer?? )
I seriously don’t ever try to annoy. Maybe I am just the kid that missed being told about the King’s new magic suit, :(

curious
3StarLounger
Posts: 331
Joined: 25 Jan 2010, 17:36

Re: Clipboard - paste items on separate lines

Post by curious »

Thank you

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 16214
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Clipboard - paste items on separate lines

Post by ChrisGreaves »

curious wrote:
25 May 2023, 23:53
Rather than have multiple clipboard entries pasted all together, is there a way to have them on separate lines? Perhaps a macro? Thank you
A great deal depends on how you define "clipboard' and "multiple clipboard entries", as well as whether your existing code loads the clipboard or not.

The macro "Curious" takes existing contents of the clipboard and parses the contents into sentences, allocating a separate paragraph ("line") to each sentence.

Cheers, Chris👌
You do not have the required permissions to view the files attached to this post.
The brain is a three-pound mass you can hold in your hand that can conceive of a universe a hundred billion light-years across (Marian C. Diamond)

User avatar
DocAElstein
5StarLounger
Posts: 656
Joined: 18 Jan 2022, 15:59
Location: Re-routing rivers, in Hof, Beautiful Bavaria

WORD paste copied items on separate lines? Maybe...

Post by DocAElstein »

@ Chris
Hi Chris :smile: ,
After quite a few hours, I figured out what you are doing.
You are basically changing this

Code: Select all

 Rather than have multiple clipboard entries pasted all together.  Is there a way to have them on separate lines. Perhaps a macro? Thank you. 
to this

Code: Select all

 Rather than have multiple clipboard entries pasted all together.
 Is there a way to have them on separate lines.
Perhaps a macro? Thank you. 
and doing it in a very convolute and confusing way, involving going back and forwards with the (windows) clipboard via the DataObject
I am not sure why. It’s a bit shirt tail and not quite so relevant to what I think is going on and wanted. (As ever, don’t misunderstand me, I am not criticising, I am all for it, it’s what we need to help some of us survive when in a few months most of us are replaced by the concise short answers of ChatGPT, Lol. I like Human thinking, even if it can be wild and illogical. That can in itself somehow finally get better more interesting answers, IMVHO. )


_.___________________________________________________________________

This is what I think we want, and what it’s all about .......
I don’t think we are so much directly involved with the (Windows) clipboard
I was not sure from the first post, but then Hans reply in the second suggested that the OP, curious, would have maybe had done a copy action on some words in a text in WORD, like this example:
He had done three copy actions in a WORD doc like this https://i.postimg.cc/y6XSt83V/Three-Mul ... ntries.jpg
Image



Now he was probably then selecting somewhere convenient and then hitting that Paste All button ( In my German WORD Alle einfügen button), which gives him all three things in a row like this:
https://i.postimg.cc/7YHTkrSS/Paste-All.jpg Image


He was wanting it more like this https://i.postimg.cc/6q02vMx7/Three-Mul ... -lines.jpg
Image





Now, what is going on there initially is that we are not really directly having so much to do with the (Windows) Clipboard. (We are probably never actually loading the (Windows) Clipboard, but that is a slightly advanced and debateable issue, to do with the theme of deffered entry) . We are not really using the (Windows) Clipboard.
What we are doing is concerning ourselves with the thing sometimes referred to as the Office Clipboard, but which is actually one of a few things that monitors copy actions. This Office Clipboard also makes its own copies in some form or another, as indicated in that margin on the left in the screenshot. ( In WORD 2003 and lower you get that up at the right possibly instead ) https://i.postimg.cc/hjV7SSC1/WORD-2003 ... pboard.jpg
https://i.postimg.cc/cCZtCV2y/WORD-2007 ... pboard.jpg
https://i.postimg.cc/FsTkFCx8/WORD-2003 ... pboard.jpg

Image



Now my proposed solution was that someone smarter than me might be able to figure out a solution from the info here:
http://www.benf.org/excel/officeclip/index.html


That is one of those older Blogs that is often very useful. But I cannot figure it out. At first glance it seems that it is suggesting a way in VBA to do what is wanted
I think if some WORD expert could do that it would be a very useful and very interesting thing
( As that link is an older one, perhaps it has a good chance of working in older WORD versions like the 2003, so maybe that might be up your street, Chris?)

Alan
I seriously don’t ever try to annoy. Maybe I am just the kid that missed being told about the King’s new magic suit, :(