Skip to Content
VB & VBA in a Nutshell: The Language
book

VB & VBA in a Nutshell: The Language

by Paul Lomax
October 1998
Intermediate to advanced
656 pages
16h 10m
English
O'Reilly Media, Inc.
Content preview from VB & VBA in a Nutshell: The Language
LoadResData Function

Syntax

LoadResData(resID, resType)

resID

Use: Required

Data Type: Variant

A numeric or string value specifying the resource ID of the data to load.

resType

Use: Required

Data Type: Variant

A numeric or string value denoting the format of the data to load. See the table below for valid values:

ResType Value Meaning
1 Cursor resource
2 Bitmap resource
3 Icon resource
6 String resource
10 User-defined resource
12 Group cursor
14 Group icon

Return Value

A Unicode string.

Description

Returns a binary (Unicode) string containing the specified resource from a resource (.RES ) file included with the project.

Resource files store graphics, strings, and other data inside the application, the contents of the .RES file being compiled into the final EXE. The advantage of storing support files in this manner is that they are permanently available to the application, unlike separate support files that can be accidentally deleted or not transferred should the application be moved. You can also store several localized versions of your resources in the .RES file that loads depending on the locale of the current machine, thereby easily internationalizing your application.

Rules at a Glance

  • You can pass a string value to restype if you are loading a custom or user-defined resource. For example:

    sRTFText  = LoadResData(102, "CUSTOM")

    This is the only case in which a string value is permitted.

  • The maximum string length returned by LoadResData is 64KB.

  • In Visual Basic, there is ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Programming Excel with VBA and .NET

Programming Excel with VBA and .NET

Jeff Webb, Steve Saunders

Publisher Resources

ISBN: 1565923588Catalog PageErrata