|
-
Jun 22nd, 2006, 01:30 PM
#1
Thread Starter
Member
[RESOLVED] User Defined type not defined error due to StdPicture
Please help. I am using the clipboard to paste an image into a richtextbox. I have found some documentation on how to achieve this but I am unable to compile.
Here is the code I have:
Public Sub InsertPictureInRichTextBox(RTB As RichTextBox, Picture As StdPicture) 'Here is where I receive the error due to Picture as StdPicture
Clipboard.Clear
Clipboard.SetData Picture
SendMessage RTB.hwnd, WM_PASTE, 0, 0
End Sub
Private Sub Form_Load()
Open AnalFileName$ For Output As #1
Print #1, "This is a test of Text above a graphic"
InsertPictureInRichTextBox AnalOutput.Out, "C:\Documents and Settings\Owner\Desktop\strakeInWindTunnel.bmp"
Print #1, "This is TEXT BELOW the graphic"
Close #1
AnalOutput.Out.LoadFile AnalFileName$, 1
End Sub
Thanks in advance for your help.
-
Jun 22nd, 2006, 01:34 PM
#2
Re: User Defined type not defined error due to StdPicture
odd... what happens when you type
Picture As
do you have stdPicture as an available choice?
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Jun 22nd, 2006, 01:35 PM
#3
Re: User Defined type not defined error due to StdPicture
A filename is not a picture - you need to actually load the picture (using the LoadPicture function) before passing it to the sub, eg:
VB Code:
InsertPictureInRichTextBox AnalOutput.Out, LoadPicture("C:\Documents and Settings\Owner\Desktop\strakeInWindTunnel.bmp")
-
Jun 22nd, 2006, 01:40 PM
#4
Re: User Defined type not defined error due to StdPicture
Nice catch si didnt notice that
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Jun 22nd, 2006, 01:51 PM
#5
Thread Starter
Member
Re: User Defined type not defined error due to StdPicture
Even if I load the picture into the object I am still unable to compile.
Dim MyPicture As StdPicture 'The StdPicture doesn't appear after As
MyPicture = LoadPicture("C:\Documents and Settings\Owner\Desktop\strakeInWindTunnel.bmp")
InsertPictureInRichTextBox AnalOutput.Out, MyPicture
Is there a Reference or a Component I should be referring to that would allow me to use the StdPicture?
Thanks
-
Jun 22nd, 2006, 01:57 PM
#6
Re: User Defined type not defined error due to StdPicture
No??
start a new project then type this
Dim sPic As StdPicture
if the StdPicture is still not showing then post what references you have as defaults...
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Jun 22nd, 2006, 02:06 PM
#7
Thread Starter
Member
Re: User Defined type not defined error due to StdPicture
Thanks Static,
I opened a new project and StdPicture appeared as an option. I compared the new project's References to my current project's References and in my current project's References I didn't have OLE Automation selected. As soon as I selected OLE Automation it showed up.
Thanks again,
Clint
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|