Pasting To RichTextBox In VB6.0
I'm pasting some formated text to my RichText. It pastes OK, but when I save it to my DB (Access) and retrieve it, it comes out non-formated (plain text). Why?
Field in DB is type Memo!
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Pasting Into A RichTextBox
Had a quick search in the archives and found nothing really relating to this, so:
I am copying formatted text from word into an RTB.
Now, if I use the AutoVerb menu to past the text it works fine...
If I use code from my edit menu which basically amounts to this:
text1.SelRTF = Clipboard.GetText
text1.SelText = Clipboard.GetText
(Neither works :S)
It pastes it without any formatting. I realise the text is being transfered in plain text, but how can I fix this please?
Pasting Into A RichTextBox
Guys, how might I go about programmatically pasting into a RTB please?
Also, is there any way of launching a mail item in OE and pasting into that, I doubt there is since there's no OE object model, but you never know.
Pasting Picture Into RichTextBox...
lets say i've got a PictureBox or an Image on my form and RichTextBox. i need to add that picture into RichTextBox where the cursor is.
i've tried using Clipboard.SetData to copy it and then SendMessage to paste, but it pastes last _test_ that was copied into clipboard, however if i open any imaging app, it will paste that image. i thought Clipboard can only hold one thing at a time...
Pasting RTF Document In Richtextbox
When I paste text with a picture BEHIND the text from a RTF document to a richtextbox, the picture then takes up its own space with the text moving above and below the picture. How can I fix this?
Keep The Color Of Richtextbox.text On Copy To Another Richtextbox
So, i have 2 richtextbox controls and the text in one of them is colored with different colors (per words like vb editor).When I copy the text to another richtextbox, I lose the colors.How can I keep the colered words?
Does anybody experienced this?
Scroll Richtextbox Send Each Line To Another Richtextbox
Well this what I want to do, lets say I have a Multiline Richtextbox1 And I want to send each line from Richtextbox1 to Richtextbox2 one by one untyl it hits last line. And in doing so it keeps the RTF format of richtextbox1 in richtextbox2.
Like this will be the processes,
There 3 line in richtextbox1,
Take line 1 of richtextbox1 sends it to richtextbox2,
Take line 2 of richtextbox1 sends it to richtextbox2
Help On Pasting
I am trying to determine if a cell in excel has something in it and if it does to copy another range of cells and paste it into a different workbook. Then if that cell has nothing in it, I need it to check another cell and do the same with a different range of cells.
I have gotten the formula to select a specific range of cells, and open a different workbook. but I can't get it to paste the information in the workbook.
The error that I am getting says
Run Time Error 1004
PasteSpecial Method of Range class failed
Know someone that owns a child care business. Go to www.kidkeeper.net. It will help them greatly
Pasting Into Cmd
Is there a way to make VB paste teXT into the CMD box?
I have the following code:
Private Sub cmdgo_Click()
Shell "cmd.exe", vbNormalFocus
Screen.ActiveControl = Clipboard.GetText
but i get an error. I tried using previous code found on this forum, but no luck, any ideas??
cheers in advance
This could really end up as an embarrassing question but what code is required to say, copy the current clipboard text into a textbox?
Help With Pasting
When I paste into a RTBox how can I make it paste starting at the point where I place the cursor?
'I'm currently using this to paste RTB1.Text = Clipboard.GetText 'but this will overwrite anything already in the RTB1
Pasting Into Different App
is there a way i can paste the contents of a text box into the last app i was in (such as internet explorer)?
Pasting Into RTB
How can I paste text from clipboard to RTB in current cursor position.
I hope you know what I mean.
Visual Basic Programmer (at least I want to be one)
You will hear a lot about it.
VPN Pasting Into
My questions both relate to VPN (which I have never used).
. . .
I have written a pgm (VB6) that can paste invoice lines into a MYOB screen. However the main user (unfortunately) gets to MYOB via a vpn.
My pasting works by remembering the latest active window hwnd (ignores it's own hwnd), and then forcing that window to the foreground (Karl Peterson's http://vb.mvps.org/samples/project.asp?id=ForceFore ) by finding it's thread, and setting Foreground window.
I guess that has buckley's chance of working into a Form in the vpn ?.
So my question is what communication is possible between the normal Windows and with the vpn window ?.
If I place text into the normal Windows clipboard, is that text present in the Clipboard within the vpn window ?.
Related to that subject is the vpn window an application window or is it a web page in a browser ?.
Can files be pushed/pulled between the two Windows ?.
Can they both see a common drive (C drive in either computer) ?.
Any other suggestions, since I don't have much of a picture of how vpn works. (Which leads into my second question.). . .
Regarding me learning how a vpn works -
My development pc is PII 300 with 256mb ram. XP Pro SP1.
If I 'installed' (?) a vpn would it be a large resource hit. Also would it add too much complexity to an OS that has been brought back from unusable a couple of times ?
What vpn would you recommend (are there different types ?).
I don't have networked pc's, but do have two pc's that can connect to the internet.
Pasting From A DOS App
I am trying to paste information that is held in a DOS application, namely 4 thirty character fields into my VB application. Although we can do this physically and in reverse from VB, we are struggling to send values held in DOS to the clipboard.
Any ideas or site info etc would be much appreciated.
Pasting Into Different Worksheet...
First post on this forum. Hello, all...
Here's the deal: I have to clear out my ComboBox list before running my macro, and it's messing up my results. If I do not clear out the ComboBox list, everything works fine, but then the list has repeated information in it. Here's the code, and the WB is attached:
Private Sub Worksheet_Activate()
Application.ScreenUpdating = False
Dim i As Integer
cbCVals = Array("Axle", "Wheel")
For i = 0 To 1
cbComponents.AddItem cbCVals(i) 'I'll need to give user the option to
'add more items in the future...
Application.ScreenUpdating = True
Private Sub Finished_Click()
Application.ScreenUpdating = False
Sheets("Database").Range("A65536").End(xlUp).Offset(1, 0).PasteSpecial _
Paste:=xlValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=True
Sheets("Database").Range("A65536").End(xlUp).Offset(0, 2).PasteSpecial _
Paste:=xlValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Application.ScreenUpdating = True
How do I modify this to 1) keep unique entries in the ComboBox list and 2) prevent the list from clearing out entirely? I think the code modification will be simple, but I'm simply not getting it.
Thanks for any assistance, folks!
Pasting Into Word
Im trying to paste a section of spreadsheet from excel into word using the code below
The problem is that there is already text in the word document, i want the table to apere below this text how can i do this?
Pasting In Worksheets With VBA
I've been writing a fairly complex VBA / Excel 2000 application for a while and getting along fine, but suddenly I'm out of my depth!
Because Activating is a Bad Thing and seems to be getting me into other trouble I won't worry you with, I'm trying to cut and paste from one worksheet to another (working round the 256 char per cell limit issue) without changing the Active workbook. So I'm trying to change this code:
TempBook.Sheets("LL Rules Examples").Activate ' this works!
ThisWorkbook.Sheets("LL Rules Examples").Activate
to this (which fails!)
TempBook.Sheets("LL Rules Examples").Columns("AY:AY").Copy
Sheets("LL Rules Examples").Range("AY1:AY1").Paste
The error message is:
Run time error '438'
Object does not support this property or method
What's the correct version? TIA
Pasting To Word
I'm trying to paste text from VB to Word. I am able to do this in Win/Office 2K but my app needs to also work in Win/Office 95. My code is the following:
Dim oWord As Object
Set oWord = CreateObject("Word.Application")
oWord.Visible = True
Set oWord = Nothing
When I try to run in 95 it tells me that Active X component can't create object. Any suggestions?
Pasting From One Sheet To Another
I am trying to paste information from one sheet to another sheet. I am using the following code:
activecell.range("C20") = value
It is not going to the proper cell unless the curvser starts in cell A1. Is there a way to get around this. If this question is not clear, I can paste the entire code that I am using.
Any help would be greatly appreciated. Thanks.
Pasting In Excel
I very often use the macros in Word and Excel to write code for me in VB.
I'm having a problem with cutting a range of cells and pasting to another area, though, because Excel won't write a line of code for the paste.
I searched this site for info on pasting in Excel, and discovered the "PasteSpecial" method, but I think I'm still messed up on the syntax.
Pasting In Word
I used the following code to paste(transfer) the contents of a rich text box control(in vb) to Microsoft Word
'open word and past the content to word
Shell ("c:Program filesmicrosoft officeofficewinword.exe"), vbMaximizedFocus
'the following lines change the font name and
'paste the contents of richtext to word
problem is some time it paste sometimes not
Plus. is there any way of taking the formatting i
have in the rich box to word when i tried the
richText1. textRTF it pasted some garbagges. any help is appreciated.
Is there a way to paste (or place) an entire recordset without iterating through it? For example, can I plug my recordset directly into an existing Word or Excel file without having to "Recordset.MoveNext" etc.?
Thanks so much!
Pasting Into Excel
I'm running some code that copies a screen of a Windows based application and then try to paste this text into Excel. Because I have several different steps that I copy then paste then clear out in Excel I am noticing that the clipboard is not being cleared and sometimes the prior screen is being pasted into Excel. If I step through the code it works fine. Could it be some sort of problem where Excel needs to be clicked on. Here's my code:
Call DDEExecute(blp, "<blp-3><COPY>")
AppActivate "Microsoft Excel"
Application.Wait Now + TimeValue("00:00:01")
Okay I'm very new to using VB. My goal is to set up excel so that I can run a macro that opens up a web page and copies information from the page into excel. So I setup a basic spread sheet this a ticker symbol in one cell. In another sheet (Links) I made an internet link to a page where I want to input the copied ticker symbol. My final sheet is a sheet called output. I want to copy the ticker, click on the link and open the webpage, paste the ticker in the search line of the webpage, then after the search is done I want to highlight and copy one line from the net, and finally I wish to paste this copied information onto my output sheet. Is this possible using VB in an excel macro? Here is the script that VB came up with when I recored my macro:
' volume Macro
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
Application.CutCopyMode = False
The error which I get when I run the macro is
Run-time error '1004'
Paste Method of Worksheet class failed.
I was done some reading on the net and the problems seems to be the "Activesheet.paste" line, I have tried unptrotecting everything, lowering the security, and just taking out the line I think the problem maybe be in the use of the clipboard. None of which worked. Please let me know your thoughts as to how I can get this to work. Thanks for your comments.
Cutting And Pasting (again)...
Maybe not a VB question, but I don't know to whom else to turn.
I have a very large file, formulas are cut and pasted to the next row as data is entered. For some reason, the VALUE of the cut row appears in the pasted row. Now, if a space is inserted somewhere in the formula AFTER it is pasted, then the correct calculated value will replace the value appearing from the cut row. This may become more evident if you open the attachment to see the described results more easily.
This spreadsheet is used to aid in the calculation of a performance indicator. It has been used since... 1998, and was about 8 MB before I paired it down to something I could attach to the forum. I believe this may have something to do with why excel seems to be backfiring a little as it's storage capabilities are tried.
Knowingly in the wrong place, but not knowing how to get to the right place, if anyone knows an appropriate forum for discussion on the topic of this question; by all means let me know and I will forage for an answer in that alternative venue.
On the other hand, I was just pondering whether it would be possible to use an on workbook update type event to modify pasted formulas somehow, so that they will display their correct value in the spreadsheet cells.
Any help or foresight is much appreciated.
Yours truly, one who is in this forums debt,
Pasting With New Formatting.
Okay, here is what I want to do, below is the code for something that copies from workbook a to workbook b. The end result I would like is for the data in workbook b to be copied as is, but with arial size 10 font. Is there any way to do this or do I need to handle this manually?
realpath = "C:invoicesStatements"
savename = realpath & pointID2
ActiveSheet.Paste Destination:=Worksheets("Statement").Range ("B1:K65536")
ActiveWorkbook.SaveAs Filename:=savename, FileFormat:=xlNormal
Thanks for the help!
I have a spread sheet that is a matrix of employees and the date. I have a find function set up to find what ever date I request, then search the column and locate empty cells (an empty cell means that person will be working that day). I the need to copy the employee information from that sheet to a different sheet, and then continue the find for the next empty cell and so on..... I have the find worked out but I am unsure how to get the information to paste on the other sheet without overwriting the previous information. Here's the protion of code I am working with.
v = ActiveWindow.RangeSelection.Column
Dim A As Range
With Worksheets(1).Range(Cells(16, v), Cells(80, v))
On Error Resume Next
Set A = .Find("", LookIn:=xlValues)
If Not A Is Nothing Then
firstAddress = A.Address
Location = ActiveWindow.RangeSelection.Address
MsgBox (Location) This is a test msg to make sure it was working
RANGEROW = ActiveWindow.RangeSelection.Row
Range(Cells(RANGEROW, 1), Cells(RANGEROW, 5)).Copy
I think this is where I need to do the paste
Set A = .FindNext(A)
Loop While Not A Is Nothing And A.Address <> firstAddress
Pasting the value is easy but I dont know how to make the range for the paste progressive?
Any sugestions greatly appreciated.
Pasting To Word
Gents, Im currently trying to export graphs ive created in excel to a word document. Im attempting to use the code as outlined below
Private Sub cmdExport_Click()
Set wdApp = CreateObject("Word.Application")
wdApp.Visible = True
Its throwing up the error "Object Required for the 3rd last line of code?
Anyone know what the problem is?
Pictures And Pasting
I need to disable pasting in my application - how could i do this?
Also, I need to take a picture of the app (only the app if possible other wise the entire screen is fine), THEN save it *** App.Path & strFileName.
Pasting Into Notepad
I am new to VB and would appreciate any help on this.
I am copying the entire contents of a listbox to the clipboard, then opening notepad and I want to paste the clipboard contents into notepad. I've used sendkeys but it pastes into my sub which i found odd.
Here is my code:
Private Sub Command4_Click()
Dim CopytoClip As String
Dim I As Integer
Set wshell = CreateObject("Wscript.shell")
CopytoClip = ""
For I = 0 To List1.ListCount - 1
CopytoClip = CopytoClip & Form1.List1.list(I) & Chr$(13) & Chr$(10)
Many Thanks in Advance.
Pasting With SendKey
I am trying to paste into a window from the clipboard with the (SendKey "^V", True) command. However nothing happens when I get to that part of my program. Can you tell me what I am doing wrong.
Pasting To Other Applications
I need to place the cursor in a word document running beside my VB program on the screen and then paste data from the clipboard into the word document. Can you tell me how to put the cursor on the word document where I want it and then paste the data automatically.
How can you make it so that you can't paste text to a Text box?
Ctrl + V
elbow deep within the boarder line. show me that you love me and that we belong together.
Pasting Into An RTF Control (try #2)
Let's try this again.
I'm using the following code to paste a picture into a richtext box.
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, wParam As Any, lParam As Any) As Long ' <--- !!
Public Const WM_PASTE = &H302
Clipboard.Clea 'clea the clipboa
txtMessage.SelStart = Len(Me.txtMessage)
txtMessage.Locked = False
'paste the picture
SendMessage txtMessage.hwnd, WM_PASTE, 0, 0
txtMessage.Locked = True
This code works fine in windows 95/98, but when I try it in 2000, nothing happens. Any ideas why this is (not) happening?<P ID="edit"><FONT class="small"><EM>Edited by PWNettle on 05/11/01 10:13 AM.</EM></FONT></P>
Copying And Pasting
I would like to know if there is a way to copy from multiple textboxes at the same time. I have about 12 to 15 textboxes that I need to cut and paste to an Excel spreadsheet and they all have to come at the same time....and no, I don't want to import the whole thing to Excel if you are thinking that could be a good solution.
Cutting And Pasting
I have a small problem with an application. When a user trys cutting and pasting onto any forms on this ap nothing happens. Is there a setting somewhere that is turning the pasting off.
Copy && Pasting
I have two buttons and a Textbox. Those two buttons are Copy and Paste. I want to know how I can Copy and Paste in the Textbox. Does anyone know how?-thanks
Is there anyway to use the copy and paste functionality of windows to paste an image from clipboard to an imagebox in VB?
Storing And Pasting Jpg
I am writing code for a button in an Access DataBase that collects data from the database and creates an excel spreadsheet from the information. I would like to put a jpg of the company Logo on the spreadsheet....so I was wondering it there is a way to store a jpeg or a picture in the access data base somewhere.....and then paste it into sheet 1, A1 of the spreadsheet when it is produced ?
Thanks for any help
Copy And Pasting
I'm looking for a simple script to paste the contents of the clip-board into a rich text box. I was also wondering what the problems are with this - for isntance can anything happen from people pasting shortcuts and files that are not text, so do I need to write my own error handling script? Thanks.
Pasting Where Cursor Is
I have a problem with my paste method, it will paste at the very bottom of the text box after all the text in it, and it won't paste where the cursor is select... how do I make it so it will paste where the cursor is?
Pasting In To A Textbox
I want to make my program check whats being pasted in to my textbox and remove all disallowed characters, for example, I need to to remove all characters except numbers and commas. What would be the best way to carry this out?
Pasting In Oulook
I have a picture copied to the clip board and I am wanting to Programmatically paste it into a outlook email message. Can anyone tell me how this is done. Here is my code.
Dim objOutlook As New Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
.Subject = lstBook.Text
' ---> .Body PasteFromClipBoard Does not work
Set objOutlookMsg = Nothing
Set objOutlook = Nothing
Pasting In A Browser
Is there any way of knowing the window handler of a box
in a browser.
I need to paste some values on a running internet site.
Vb Pasting Problems
there's a weird bug in vb 6 that causes some code snippets to be cut off abruptly. it's really annoying because i have to replace what was left out manually. anybody here have the same problem? or possibly know a patch to fix it?
I have 2 textboxes on a form. I have 1 paste command in a menu.
My question is, how do i get the copied text to be pasted in the textbox the user has selected instead of just one specified textbox. For example, the user clicks on text2 and then goes to the menu and clicks paste. How do i get it to paste into text2 and not text1 or vice versa.
Also how do you get it to paste where the cursor is?
Pasting To Word
Is there any way of making word pick
the font types of a sentence I am pasting??
Write now i am changing the font type using SENDKEY from
VB. Problem is that i usually have 2 types fonts in a sentence
It changes one not the other.
the following program should paste the contents
of richtext box to word
Private Sub richHaHU_DblClick()
Shell ("c:Program filesmicrosoft officeofficewinword.exe"), vbMaximizedFocus
'change the font in word
SendKeys ("%o") 'this is Alt + o to open the format menu
SendKeys ("f") 'this is to bring the font dialog box
SendKeys ("%f") 'this is to set focus on the font name box
SendKeys ("firsFontName") 'this is the new font name i want
SendKeys ("^v") 'this is Ctrl + v to paste what i have in the clipboard
any other method or suggestion is appreciated
Hello..... I did look for the answer... I feel I am close to get it.. but I am not there yet!
Here is my code:
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Sub Command1_Click()
keybd_event VK_SNAPSHOT, 0, 0, 0
Shell "mspaint.exe", vbNormalFocus
What I am trying to do is take a shoot of the screen.. and paste it in paint... I can do the pasting with the sendkeys function... but I cant get to screen shot!! And actually I looking for only getting a shoot of my VB app.
Thank you in advance.