Help - Search - Members - Calendar
Full Version: Property setting in VB6
BleepingComputer.com > Software > Programming
   
Al Coda
I am a new programmer and wonder if anybody could tell me what I am doing wrong. I want to set the SourceDoc property for an OLE object at runtime and am using the following code: OLE1.SourceDoc = C:\ etc. being the path followed by a backslash and the file name. I have tried it with and without quotes around everything after the =. If I have set the SourceDoc property at design time, it's fine and if I include the above code, it does something because the OLE box becomes blank. It just doesn't do what I want it to. What I am trying to accomplish is enable the user to select a particular file for the OLE box at runtime with a file box which I would pass to the property with a variable. Anyway, any help with this would be appreciated.
Batchwood
No one has been able to help you so you may find an article to give you some direction here:
http://www.findingfacts.com/L3/L3_2_28_33.php
eleazarmeza
You should try to use Createlink method, i used it at runtime and it worked. thumbup.gif

Example:

ole1.createlink("c:\i_hope_this_will_be_useful_for_you.doc")

This is kind of funny i was looking for answers and I ended up trying to help someone else.


tongue.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.