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 / March 2006

Tip: Looking for answers? Try searching our database.

Problem with clipboard macro

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Brian Holfield - 27 Feb 2006 09:50 GMT
>From docA I first clip TextA to the Offfice Clipboard, then I clip
TextB to it.
In docB I record Mymacro with these actions: First I create a table of
one row and two columns. Then I open the clipboard, then paste TextB
into the first cell of the table, then delete TextB from the clipboard.
Now I paste TextA from the open clipboard into the second cell of the
table, and then delete TextA from the clipboard. Now I close the
clipboard.

When I next have a new TextA and Text B on the clipboard I run Mymacro.
It pastes TextB two times and leaves TextA and TextB on the clipboard.

Any way to get the macro to do what I need, that is paste TextB  then
TextA and delete them from the clipboard?
Helmut Weber - 27 Feb 2006 16:14 GMT
Hi Brian,

have a look at the code you recorded.
There is probably no trace of anything like clipboard in it.

As nobody else has answered so far,
I dare to suppose, the office clipboard is not accessible
programmatically, except that "paste" pastes items
from the office clipboard in the reverse order they
appear in the clipboard window.

Applies to Word 2003,
I don't know about Office 12.

If I am wrong, somebody will correct me.

Signature

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"

Tony Jollans - 28 Feb 2006 00:21 GMT
> If I am wrong, somebody will correct me

LOL - If only Paste _would_ paste from the Office Clipboard life would be
easier. Paste always pastes from the Windows Clipboard.

Brian,

As you talks of selectively deleting office clipboard entries you must have
Word 2002 or 2003. In these versions there is, as far as I know, no way to
access the office clipboard entries via code and I don't think there is any
way to do what you want without using code in the copy operation as well as
the paste operation.

--
Enjoy,
Tony

> Hi Brian,
>
[quoted text clipped - 19 lines]
> Win XP, Office 2003
> "red.sys" & Chr$(64) & "t-online.de"
Helmut Weber - 28 Feb 2006 00:43 GMT
Hi Tony,

right you are!

>Paste always pastes from the Windows Clipboard.

When I recorded "Paste all" from the office clipboard,
with 3 items in there, i got:

Selection.Paste
Selection.Paste
Selection.Paste

So I thought...

Should have tested it.

:-)

Cheers

Signature

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"

Brian Holfield - 02 Mar 2006 17:34 GMT
Odd that Word uses Windows clipboard when it has its own clipboard, but
that's the way it is.

Is there a way around this by clipping TextA in variableA and TextB
into variableB? Seems possible to me, but I'm too green a user to be
able to do it.

> Hi Tony,
>
[quoted text clipped - 24 lines]
> Win XP, Office 2003
> "red.sys" & Chr$(64) & "t-online.de"
Helmut Weber - 02 Mar 2006 18:24 GMT
Hi Brian,

>Is there a way around this by clipping TextA in variableA and TextB
>into variableB? Seems possible to me, but I'm too green a user to be
>able to do it.

sure. You may put TextA into a docvariable TextA, etc.
and preserve all for later use, with loosing formatting.

Or you may use autotext entries,
which seems to me the best solution for your task.

Signature

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"

Tony Jollans - 02 Mar 2006 19:08 GMT
As I said before there, you will need some sort of code in the copy
operation(s). With code there are several ways to do it but the most obvious
way of interacting with the facility Microsoft have created for just this
purpose isn't available - I really don't know why, it's just, as you say,
the way it is.

--
Enjoy,
Tony

> Odd that Word uses Windows clipboard when it has its own clipboard, but
> that's the way it is.
[quoted text clipped - 31 lines]
> > Win XP, Office 2003
> > "red.sys" & Chr$(64) & "t-online.de"
 
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.