Solved

Dynamically load file in Visual Basic 6 add-in project

Posted on 2007-03-30
4
352 Views
Last Modified: 2008-01-09
Hi there,

I've just written an add-in for Outlook in visual Basic 6 and I want this add-in, among other things, to dynamically load files (more precisely gif images intended to be put in picture boxes).
How can I do that ?

I read that the location of the add-in dll was written in the registry once the add-in is registered but I didn't find it.

Other possibility : include the gif files in the project as related documents.
But then, how can I refer to them in the code ?

Thanks in advance
0
Comment
Question by:B_B_Boris
  • 2
4 Comments
 
LVL 32

Expert Comment

by:Robberbaron (robr)
ID: 18828077
I thought if you loaded them into a Image Strip they compiled with the project.

cant find ImageStrip control at the moment though.
0
 
LVL 13

Expert Comment

by:Mark_FreeSoftware
ID: 18830855

or you could include them as resources, and extract at runtime :)

0
 

Author Comment

by:B_B_Boris
ID: 18842710
Thank you for your posting.

I've just tried to include an image as a resource.

The problem is that it cannot be a bitmap, it has to be a gif file : When I try to save my gif file as a bitmap, the background turns black even though it was transparent in the gif.

I tried to create a "custom" resource but when I write
    Img_phone.Picture = LoadResData(101, "CUSTOM")
in the code, I get an error message saying "Execution error 424 : An object is required"

???
0
 
LVL 13

Accepted Solution

by:
Mark_FreeSoftware earned 500 total points
ID: 18844420

loadresdata will not work in this case


you have 2 options:

1 (recommended, much easier)
extract the resource to a temporarily file, and load that file in your picturebox

2(not recommended, hard)
create a picture in memory, and copy the data into that
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now