473,394 Members | 1,845 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Clipboard Related Question

Hi

I want to write some VB code that copies to the clipboard then pastes it
later, however the Clipboard is a system device that is shared between all
applications and that may interfere with other application both ways.

Is there any way to solve this problem, I have noticed that some application
have more than 1 clipboard are these also system clipboard

Thank you in advance,
Shmuel Shulman
SBS Technologies LTD
Sep 15 '05 #1
6 1593
S Shulman wrote:
I want to write some VB code that copies to the clipboard then pastes it
later, however the Clipboard is a system device that is shared between all
applications and that may interfere with other application both ways.
True. You shouldn't use the clipboard as a means to send data from one
part of your application to another. It points at structural problems in
your app, and it's really annoying if the user uses an external clipboard
history program (like I do, ClipMate) and the clipboard is reset with new
content all the time.
Is there any way to solve this problem, I have noticed that some
application have more than 1 clipboard are these also system clipboard


I'm not quite sure about that. In fact, Office has such functionality and
I don't know exactly where it comes from - there might be an API
somewhere. But remember: the clipboard is a device that the user controls.
As a user, I want to decide what goes on my clipboard, whether there's
only one or multiple of them.
Oliver Sturm
--
Expert programming and consulting services available
See http://www.sturmnet.org (try /blog as well)
Sep 16 '05 #2
I agree with everything you said but it is necessary because I wnt to insert
into Word formatted text and that is probably the only way

Cheers,
Shmuel
"Oliver Sturm" <ol****@sturmnet.org> wrote in message
news:xn***************@msnews.microsoft.com...
S Shulman wrote:
I want to write some VB code that copies to the clipboard then pastes it
later, however the Clipboard is a system device that is shared between all
applications and that may interfere with other application both ways.


True. You shouldn't use the clipboard as a means to send data from one
part of your application to another. It points at structural problems in
your app, and it's really annoying if the user uses an external clipboard
history program (like I do, ClipMate) and the clipboard is reset with new
content all the time.
Is there any way to solve this problem, I have noticed that some
application have more than 1 clipboard are these also system clipboard


I'm not quite sure about that. In fact, Office has such functionality and
I don't know exactly where it comes from - there might be an API
somewhere. But remember: the clipboard is a device that the user controls.
As a user, I want to decide what goes on my clipboard, whether there's
only one or multiple of them.
Oliver Sturm
--
Expert programming and consulting services available
See http://www.sturmnet.org (try /blog as well)

Sep 17 '05 #3
S Shulman wrote:
I agree with everything you said but it is necessary because I wnt to
insert into Word formatted text and that is probably the only way


Well, if you use the clipboard to transfer text to another application,
it's no longer strictly application-internal use, of course. Then again,
if the user doesn't expect the clipboard content to be changed at that
point (because he didn't click a Cut or Copy command), I'd still be
strongly opposed to it.

Why should that be the only way? Normally you use automation to control
Word from another application and there's really (nearly) nothing you
can't do this way. Here's a short introduction for doing this in C#:
http://www.c-sharpcorner.com/Code/20...FromDotNet.asp

This came out of google, there's loads more to be found if you need it.

Oliver Sturm
--
Expert programming and consulting services available
See http://www.sturmnet.org (try /blog as well)
Sep 18 '05 #4
Thank for your response,
What I want to do is the following: store in the database .rtf text then
paste it into a word doc with the important formatting!, if I will use the
standard method that you are using then the formating will be lost, that is
why I probably need to use the Clipboard that doesn't forget the formatting
(I can get it to the clipboard by reading from the database into RichText
control).

Cheers,
Shmuel
"Oliver Sturm" <ol****@sturmnet.org> wrote in message
news:xn****************@msnews.microsoft.com...
S Shulman wrote:
I agree with everything you said but it is necessary because I wnt to
insert into Word formatted text and that is probably the only way


Well, if you use the clipboard to transfer text to another application,
it's no longer strictly application-internal use, of course. Then again,
if the user doesn't expect the clipboard content to be changed at that
point (because he didn't click a Cut or Copy command), I'd still be
strongly opposed to it.

Why should that be the only way? Normally you use automation to control
Word from another application and there's really (nearly) nothing you
can't do this way. Here's a short introduction for doing this in C#:
http://www.c-sharpcorner.com/Code/20...FromDotNet.asp

This came out of google, there's loads more to be found if you need it.

Oliver Sturm
--
Expert programming and consulting services available
See http://www.sturmnet.org (try /blog as well)

Sep 18 '05 #5
S Shulman wrote:
Thank for your response,
What I want to do is the following: store in the database .rtf text then
paste it into a word doc with the important formatting!, if I will use the
standard method that you are using then the formating will be lost, that
is why I probably need to use the Clipboard that doesn't forget the
formatting (I can get it to the clipboard by reading from the database
into RichText control).


Well, to say it most clearly: I think this is nonsense. I'm no expert on
Word automation, but I'm absolutely sure there is a way to control the
formatting of text, probably also of the RTF content you have. But whether
this is true or not, misusing the clipboard to perform the task is just
not an option I would consider.

I've been having a quick look and the only method to get the RTF text into
Word without using the clipboard seems to be inserting it from a file. Why
don't you do that from your app? I'm not saying there might not be a "more
direct" way available, but it's certainly an option to create a temporary
file with your RTF content and call Document.Content.InsertFile to get the
content into the Word document.
Oliver Sturm
--
Expert programming and consulting services available
See http://www.sturmnet.org (try /blog as well)
Sep 18 '05 #6
Thanks again, however the option of inserting a file is not the best because
it is time consuming and tie is critical in this case.

Shmuel

"Oliver Sturm" <ol****@sturmnet.org> wrote in message
news:xn****************@msnews.microsoft.com...
S Shulman wrote:
Thank for your response,
What I want to do is the following: store in the database .rtf text then
paste it into a word doc with the important formatting!, if I will use the
standard method that you are using then the formating will be lost, that
is why I probably need to use the Clipboard that doesn't forget the
formatting (I can get it to the clipboard by reading from the database
into RichText control).


Well, to say it most clearly: I think this is nonsense. I'm no expert on
Word automation, but I'm absolutely sure there is a way to control the
formatting of text, probably also of the RTF content you have. But whether
this is true or not, misusing the clipboard to perform the task is just
not an option I would consider.

I've been having a quick look and the only method to get the RTF text into
Word without using the clipboard seems to be inserting it from a file. Why
don't you do that from your app? I'm not saying there might not be a "more
direct" way available, but it's certainly an option to create a temporary
file with your RTF content and call Document.Content.InsertFile to get the
content into the Word document.
Oliver Sturm
--
Expert programming and consulting services available
See http://www.sturmnet.org (try /blog as well)

Sep 18 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: xyz | last post by:
I have a menu item to handle clipboard actions (cut, copy, paste). When I paste text that I copied from a Hungarian web page, the display looks normal on my RichTextBox, but the text retrieved from...
8
by: LG | last post by:
Just have a question with regards to the clipboard, and how to read what other applications (Adobe InDesignCS) place in the clipboard. I am currently in the process of creating a booklet from a...
5
by: TC | last post by:
Hello, I am familiar with obtaining source file reference material from the system clipboard using the old Win32 API. For example, copy an Excel chart onto the clipboard and goto Word. Under,...
1
by: Nithi Gurusamy | last post by:
Hello everyone: I am new to .NET world. Someone please show me how to use the Clipboard class in an unmanaged code. Assume I have a MFC CString variable strText. How to put the value in...
2
by: Roy Gunnarsson | last post by:
Hello all, I have a VERY simple windows application that decrypts data files we receive from a partner. The decryption is handled by a COM component our partner provided us with (thus we have no...
4
by: JohnR | last post by:
Hi all, I'm finally sick and tired of manually generating get/set properties for each private variable in a class so I'm trying to create a macro to do it. I'm stuck because I can't figure out...
6
by: S Shulman | last post by:
Hi I want to write some VB code that copies to the clipboard then pastes it later, however the Clipboard is a system device that is shared between all applications and that may interfere with...
0
by: James Russo | last post by:
Hello, I have an application which requires an image to be retrived from the clipboard. So, I am writting a quick C# windows application to take images from a webcam and store a single frame on...
3
by: Jaez | last post by:
As a newbie to javascript and asp.net 2 I have come across a problem related to the windows clipboard. I have written an application in vb6 which collects data and puts it on the user's...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.