PDA

Click to See Complete Forum and Search --> : VB-Paste an Image into anouther Program


F0zzy
Dec 7th, 2003, 08:17 AM
The code below will open an Edit program and Paste the selected image into it



Public SelectedFile as String

Dim OpenFile As String
Dim ReturnValue


Clipboard.Clear ' Clear Clipboard.
Clipboard.SetData LoadPicture(SelectedFile) ' Get bitmap.
Me.WindowState = 1 'Minimize The program
OpenFile = (frmOptions.txtEditPath.Text) 'Get the path and name of the program for edit
ReturnValue = Shell(OpenFile, vbNormalFocus) 'Shell the program to open and give it focus
AppActivate ReturnValue ' Activate the Program
SendKeys "^{v}", True 'Sends the key strokes Ctl+v to the Edit program the v must be lower case


Where 'SelectedFile' is the path as a 'String' to the image file you wish to edit.


Works with VB6 Running Xp Pro and Paint Shop Pro