Solved

Dynamically load file in Visual Basic 6 add-in project

Posted on 2007-03-30
4
355 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

776 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