473,472 Members | 2,139 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 1596
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: 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
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
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.