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.
Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.
Page 1 of 1
Property setting in VB6 VB6 problem with OLE property setting
#2
Posted 30 June 2005 - 08:53 PM
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
http://www.findingfacts.com/L3/L3_2_28_33.php
#3
Posted 25 July 2005 - 03:57 AM
You should try to use Createlink method, i used it at runtime and it worked.
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.
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.
Share this topic:
Page 1 of 1

Help

Back to top








