paste clipboard content to a hidden MS word file (opened buthide via execurteshell)
by mxu » Sat, 06 May 2006 04:31:42 GMT
Hello.
I can use executeshell to open a hidden MS Word file, is there a way for
pasting
the clipboard contents to the file ?
Regards
ming
<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns=" http://www.**--****.com/ ">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:Arial;
color:windowtext;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>Hello.<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>I can use executeshell to
open a hidden MS Word file, is there a way for pasting <o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>the clipboard contents to
the file ?<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>Regards<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>ming</span></font><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'><o:p></o:p></span></font></p>
</div>
</body>
</html>
Re: paste clipboard content to a hidden MS word file (opened buthide via execurteshell)
by Ben » Sun, 07 May 2006 08:12:37 GMT
If you are using windows could wxAutomationObject be used as a
workaround? The Word VBA object model has a method Paste() which you
could probably call from wxAutomationObject.
Good Luck,
Ben
Similar Threads:
1.Office Clipboard shows icon(s) when first opened, and can't paste XP clipboard contents
Hi,
I'm using Windows XP Home SP2 and Office 2003, a wired keyboard
and using Word 2003 as my email editor.
When I try to copy from the internet and paste into Outlook all I get
is an icon rather than the text/picture I've copied (Ctrl-C) from the
net. This happens everytime if Outlook/Office is closed when I make my
selection. However, if Outlook/Office is open when I make my selection
then the selection pastes as expected. I'm pretty sure this didn't use
to happen, and it doesn't happen when I use Windows 2000 SP4 and
Office XP/2002 at work.
Is there an option to allow this, or is it a bug or something that
wipes out the clipboard when I open Office? I would expect that
the XP clipboard is separate from Office and should contain whatever
I copy under any circumstance. Therefore I have to assume that
Office isn't handling the data from the XP clipboard properly when
opening. When I first open Outlook, if I look in the clipboard I can
see anywhere from 1-4 icons. There's a blue one with a green arroe
like a floopy insert icon, then there are up to 3 other Yellow floppy
icons one with a green checkmark, one with a red cross (X), and one
plain yellow floppy icon.
I thought I'd read something about the first entry in the Office
clipboard getting mangled or deleted or something when Office opens,
but I can't recall where. Anyway this is really driving me
crazy, if you can help me I'd greatly appreciate it.
Thanks,
Norm
2.How to Programatically paste the clipboard contents to a word
3.How to Programatically paste the clipboard contents to a word docu
Can anyone tell me how to Programatically paste the clipboard contents to a
word document using C#??
I am very new to programming (2 months). I am using Visual Studio.NET and
C#. I have made an Add-In for Word. One of the controls in my Add-In
Programatically copies a textbox (richTextBox1) contents to the Clipboard. I
used the following code:
Clipboard.SetText(richTextBox1.Text);
Then if I right click and select Paste the contents are pasted onto the Word
document.
However, I would like to Programatically paste the clipboard contents to
the word document? Can anyone tell me how to Programatically paste the
clipboard contents to a word document using C#??
I WAS able to instantiate a class using the "Interface" in the Object
Browser at Microsoft.Office.Interop.Word named "Selection" which contains a
method named "void Paste()".
However when I derived a class from it and then instantiated the class and
called the "Paste()" method it threw an error because there is no code in the
paste method. Can you give me an example of code that I can put into the past
method??
namespace WordAddIn2
{
class Class2:Selection //Implements the Interface found at
Microsoft.Office.Interop.Word.Selection
{
#region Selection Members...
public void Paste() // The paste method of the derived class
named Class2
{
throw new NotImplementedException();
..............................................................................................................................................................................................................
Class2 y = new Class2(); // In my Windows Form I have
instantiated Class2 so that I can use the Paste method
y.Paste();
................................................................................................................................................................................................................
When I run the program it throws an exception because I have not Implemented
the Paste Method. The problem is that I do not know how to Implement the
Paste method. Does anyone know how?????