473,769 Members | 6,404 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Paste between Word and RTFtextbox

15 New Member
I am using ASP.net 2003 to write program. I have a RTFtextbox and I want to copy the words from MS WORD and paste it in the RTFtextbox. However, it said :
System.Argument Exception: 無效的檔案格式。
at System.Windows. Forms.RichTextB ox.StreamIn(Str eam data, Int32 flags)
at System.Windows. Forms.RichTextB ox.StreamIn(Str ing str, Int32 flags)
at System.Windows. Forms.RichTextB ox.set_Selected Rtf(String value)

I write a menu for the user to paste in the RTFtextbox.

Dim data As IDataObject = Clipboard.GetDa taObject
If data.GetDataPre sent(DataFormat s.Text, True) Then
rtbCurrent.Sele ctedRtf = data.GetData(Da taFormats.Text, True).ToString
End If

Please help!Thanks!
Dec 3 '07 #1
0 976

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2751
by: PaulMac | last post by:
I need to be able to copy and paste the contents of an HTML page into a field in my adp. Is this even possible? In Word I can click Paste Special, and select HTML and it copies the table just as it looks on the html page. When I try to paste into a varchar field, I don't have the option to paste special HTML, and it pastes in but loses all the formatting ie. rows and colums. actually, in word you can just select paste and it works...
7
11639
by: lgbjr | last post by:
Hello All, I¡¯m using a context menu associated with some pictureboxes to provide copy/paste functionality. Copying the image to the clipboard was easy. But pasting an image from the clipboard is proving to be more difficult. These pictureboxes are bound to an AccessDB. If the user wants to add an image, they select an image using an OpenFileDialog: Dim result As DialogResult = Pic_Sel.ShowDialog() If (result = DialogResult.OK) Then
11
2174
by: RobKinney1 | last post by:
Hello, I am looking for a clever way to prevent someone from pasting copied text outside of my app. I know how to monitor the clipboard and get an WM_DRAWCLIPBOARD message when text is stored in the clipboard... If only I could detect some kind of outgoing message that the clipboard is about to paste, then I could check to see if my app is currently in focus and allow/deny as necessary.
0
1766
by: R Reyes | last post by:
Hi. I'm trying to paste copied (or at least I think it's copied) text from an MSWord document into the SAME MSWord document (not Excel). The code is below. It works up until "PASTE TEXT". Please help and thanks in advance! // Select and copy bookmark wordBookmark = "bmSECTION_TRANSLATION"; object startSECTION_TRANSLATION = wordDocument.Bookmarks.get_Item(ref wordBookmark).Range.Start;
1
6830
by: christianlott1 | last post by:
I want to copy an Access pivot table into word with vba. I'm guessing I'd need to Select All, copy to the clipboard, and paste special into word at a bookmark. I know how to address the bookmark, I just don't know how to select, copy and paste (actually, I will probably be able to find the paste special command for word) via vba. Right now I have:
0
1137
by: Killer42 | last post by:
Nice simple one today. Why does MS Word beep every time I paste, and how can I prevent it doing so? Apart from turning off all audio feedback, of course. Correction - every time I paste plain text from another application. It doesn't beep if I copy and paste within word.
5
23487
by: deve8ore | last post by:
Hello, I have a Word document called (), a named range that will open up a new Word doc dependent on what a user selects in Excel. Could someone please guide me on how to set up VBA code to copy and paste ALL sheets in the Word doc and paste into Excel? The sheets normally contain a graph or two, so if it's a copy & paste special as a picture, that's fine. Any help would be appreciated. Thank you,
6
3325
by: Flyzone | last post by:
Hello, i'm trying to paste copied text from word into an input box. This text is saved into a oracle db and then used as text in another javascript. The problem is that using the saved text (encoded and decoded in the db to avoid sql injection) have some special char that block the javascript execution (i think is unicode char). So i would like to detect and delete this char with a javascript function (i can't disable copy and paste),...
6
8204
by: Paul Mc | last post by:
Hi all, It's a little late in the day for me so please forgive as i need my bed.!! The issue is i need to open a word doc (say "c:\temp.doc) and paste into it, but i only can work out how to open a NEW doc ' Creates a new document and pastes Clipboard contents. ' Saves the document in the Word directory and closes the ' document.
0
9423
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10045
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9993
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8870
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7406
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6672
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5298
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.