Editorials
Office and .NET Together: Ken
editorializes on the importance of these two technologies, working together.
(Feb 2003)
Is Database Security in Oxymoron?:
Mary proposes that no data is really safe, in this editorial. (Jan 2003)
Get Your Feet Wet: Web
Services make a great place to get started with .NET. In this editorial, Ken
suggests a plan of attack. (Dec 2002)
Don't Try This at Home:
Ken's Dad has trouble with eBay refreshing its site while he's logged in.
ASP.NET makes it easy to avoid this situation, and in this editorial, Ken
discusses the merits of ASP.NET's dynamic site loading functionality. (Oct 2002)
Out of the .NET Fog:
There's a lot of FUD (Fear, Uncertainly, and Doubt) surrounding what you need in
order to use .NET. In this editorial, Ken reviews the issues involved in
installing and using both the .NET Framework and Visual Studio .NET. (Aug 2002)
Yukon Ho! SQL Server v.Next: Mary
and Andy provide a first look at an important addition to Microsoft's server
family: the next version of SQL Server. (Mar 2002)
New Office Smarts: Andy
investigates the new Office 2000 feature, Smart Tags, in this editorial. (May
2001)
Prepare for .NET: Andy provides
considerations for Office/Access/VB developers moving to .NET. (Dec 2000)
Brave .NET World:
Andy wrote a very interesting early introduction to .NET in this editorial. (Sep
2000)
White Papers
Inheritance and Interfaces--Upgrading to Microsoft .NET: Learn about the
differences between class inheritance and interface implementation in Microsoft
Visual Basic .NET in this white paper written by Andy Baron.
Replacing API Calls with .NET Framework Classes: Moving to .NET? Need to get
rid of existing API calls? This paper discusses how to take advantage of the
P/Invoke mechanism in .NET.
Getting Started with Windows Forms: If you're moving to .NET, you'll find
Windows Forms to be both different and more of the same, compared to your
existing development environment. This article gets you started.
Working with MDI Applications and Creating Menus: Things have changed since
VB6, and creating MDI apps and working with menus are among the major changes.
This white paper introduces the concepts.
Exception Handling in VB.NET: It's far easier to deal with errors in VB.NET
than it was in VBA/VB6. This white paper introduces the concepts involved in
handling exceptions intelligently in VB.NET.
Replacing API Calls the Manipulate Menus: It's old, but could be relevant if
you've got API calls in your Office applications that manipulate menus.
CommandBars replaced standard menus a while back, and if you need to replace the
old code with code that manipulates CommandBars, start here.
Articles
New List-Filling Options in Access 2002 (Access 2002): Andy provides a
discussion of several new ways to fill lists with data in Access 2002. (Dec
2001)
Windows Services--New Base Classes in .NET Make Writing a Windows Service Easy:
Windows services are applications that run outside of
any particular user context in Windows NT, Windows 2000, or Windows XP. The
creation of services used to require expert coding skills and generally required
C or C++. Visual Studio .NET now makes it easy for you to create a Windows
service, whether you're writing code in C++, C#, or Visual Basic. You can also
write a Windows service in any other language that targets the common language
runtime. This article walks you through the creation of a useful Windows
service, then demonstrates how to install, test, and debug the service. (Dec
2001)
Power Over the Task Pane--Programmatically Managing the Task Pane in Office XP
(Office XP): If you've used Office XP, it would be hard to believe that you've
not been struck by the change to the File | New menu item in all the Office
applications. Previously, when you asked the application to create a new
document for you, it popped up a dialog box allowing you to locate a path for
your new file. The same thing happened when you attempted to open an existing
document. No longer! In Office XP, it seems like nothing at all happens when you
attempt to open an existing document, or create a new one. Actually, if you're
paying attention, you'll note that the application displays the task pane - a
fancy toolbar, normally docked to the right side of the application window. This
article describes how to programmatically interact with this new user interface
element. (Nov 2001)
.NET Classroom: Manipulating Text with the StringBuilder Class (.NET): Ken
compares working with strings using the String class and the StringBuilder class
in this short piece for the defunct MSDN newsletter. (Sep 2001)
Conditional Formatting--Control Fields' Appearance at Design and Run Time
(Access XP/2000): Since Access 1 shipped, developers have been asking for some
way to have rows on continuous forms show formatting depending on the values of
individual fields. And, since Access 1, developers have been finding hacks and
work-arounds to this problem. This is because Access has always viewed each
instance of a given control on a continuous form as a single control; any
property changes you make to any instance of the control applied to all
instances. Finally, starting in Access 2000, Microsoft has provided a solution,
and it works well. By applying formatting rules to text box and combo box
controls on your forms, you can cause Access to format the data for you. This
article discusses how to take advantage of conditional formatting in your
applications. (Sep 2001)
.NET Classroom: Reflecting on Stack Traces (.NET): .NET finally makes it
possible for Visual Basic developers to determine information about the stack as
code runs. This short article for the defunct MSDN newsletter describes how to
take advantage of the rich functionality of the StackTrace and StackFrame
classes. (Jun 2001)
COM Add-Ins--Introducing COM Add-Ins for Office (Office XP/2000): Office
2000 introduced COM Add-ins, a common add-in model for all VBA host
applications. This article and its successor show how you can take advantage of
this useful technology to create add-ins that work in any Office application.
Find Part II
here. (May/Jun 2001)
Get Started with WinForms (.NET): Ken and Paul D. Sheriff wrote this
introductory article on Windows Forms for VBPJ magazine. (April 2001)
Providing Accessibility--Programming Windows Accessibility Features
(VBA/VB6): The Win32 API includes a number of features that make it easier for
persons with disabilities to use their computers. These features are extensions
to the operating system, and they affect the behavior of the system, no matter
which application is running. This article discusses the use of these API
functions from within Office and VB applications. (Dec 2000)
Manipulate CAB Files Programmatically (VB6): Neither VB nor Windows includes
simple functionality for manipulating CAB (compressed archive) files. This
article from VBPJ magazine demonstrates how to use the Windows API to do the
job. (Nov 2000)
Who Wrote This? Digging Up File Version Information (VBA/VB6): Ever wonder
where an executable file came from or what company created it? Every executable
file, OCX, DLL, device driver, and font can contain information about its
origins, national language and code page, contents, target operating system, and
more. When the program's developer builds the project and creates the program
file, the development environment - whether it's C++ or Visual Basic - allows
the developer to encode information about the application into the executable
itself. Windows has the capability to browse this information (select any of
these files in Windows Explorer, then right-click and select Properties; on the
dialog box that appears, select Summary to see the properties assigned to the
file), and so can you - if you know the tricks. This article discusses a
VersionInfo class, which allows you to avoid the difficult gyrations required by
doing this work directly using the Windows API. (Sep 2000)
Replace API Calls Using WMI (VBA/VB6): Microsoft Windows Management
Interface (WMI) makes it simple to retrieve or set system information. This
article from VBPJ shows how to take advantage of this rich technology. (Aug
2000)
Screen Resolution, Resolved! Scaling VBA Forms to Match Screen Resolution
(VBA forms--not Access): Much has been written about scaling Access forms to
match screen resolution (a lot of it by MCW authors), but what about VBA forms?
If you've written applications in Word, Excel, PowerPoint, or Outlook, you may
want to make sure your forms appear looking the same as when you created them,
even if the resolution has changed. This article provides a simple class that
handles this task for VBA forms. (Jun 2000)
Course
of Events, Part I-File Handling with Dir, FileSystemObject, and WithEvents
(VBA/VB6): There's a reason events and event hooks are part of the VB/VBA world.
Most developers don't think about taking advantage of these in their own code,
but raising and synching events can make your code more flexible. This article
introduces the concept of using events to handle otherwise inflexible standard
operations. Find Part II
here. (Apr 2000)
Thinking Outside the Box--Manipulating Non-Client Window Settings (VBA/VB6):
In this installment of the Class Act column, Ken discusses the NonClientMetrics
class, which allows you to interact with parts of Windows you may have thought
were inaccessible, including window borders, application menus, and more. (Mar
2000)
WithEvents Revisited--Create a SpinButton class: (Microsoft Access) In the
November 1999 issue of MOD, Ken wrote an article concerning the use of
WithEvents to create a Text box/list box combination control that allowed
you to search for text in the list box while typing into the text box. The point
of the article (besides providing a useful user interface component) was to
demonstrate how you can grab events from anyplace, and react to them in your own
code. This makes it possible for you to separate UI objects and their event code
- basically, providing a way to create your own groups of controls, much as you
would if you were to create your own ActiveX control in Visual Basic. (Feb 2000)
Visual
Basic Design Time Techniques to Prevent Runtime Version Conflicts (VB6):
Managing compatibility issues when creating COM components with VB6 is a complex
topic, and Brian Randell, along with Ted Pattison, cover it all in this in-depth
coverage of the topic from MSDN magazine. (Jan 2000)
Implementing Sorts--The Quicksort Algorithm (VB6/VBA): You can find code to
sort data in lots of places, but this article focuses on implementing an
interface that allows you to supply the "brains" of the sort at runtime. This
sort of flexibility has been used by C++ developers forever, but the addition of
interfaces to VBA (and VB) makes it possible to create callback procedures in
your language, as well. This article demonstrates a useful technique for taking
advantage of interfaces. (Jan 2000)
Getting WithEvents--And Implementing a Nifty Incremental Search (Access):
Using the WithEvents keyword, you can easily separate objects and their event
procedures. Once you've set up a WithEvents link between an object and a class
module, code in the class module can react to events of the object, as if the
code existed locally. This article discusses this technique and shows how to use
it to create an incremental search class for use within Access. (Nov 1999)
O2K Collections--Creating Custom Collections (VB6/VBA): The VBA Collection
object provides a great way to work with a group of objects as a single entity
at run time. If you've used this data structure, you know how nice it is to be
able to work through a collection of objects, visiting each item in turn, within
a single loop. However, when it comes to creating your own collections - for,
say, an application or ActiveX component - things aren't as simple as they might
appear. There's a particular pitfall that can ruin your plans when you try to
create an object model using a public collection. This article describes a
solution, which is to create a collection class that protects your collection.
(Oct 1999)
Access Form Control--Introducing the FormInfo Class (Access 2000/97):
Although Access forms perform well when working with data, they fall short when
you need to position a form at a specific screen location, or if you need to
determine the form's screen location. The only control of form positioning and
appearance Access provides are the properties on the Format page of the
Properties window, and the MoveSize method of the DoCmd object. If you want more
control over where you place your forms, and how the forms appear, you need to
take matters into your own hands. To make this necessary functionality
available, we've provided the FormInfo class, which allows you to precisely
control the placement and appearance of forms. Find Part II
here. (Jul/Aug 1999)
External Components--Component Development with Visual Basic (VBA/VB6): One
of the more powerful aspects of writing applications in VBA is that you can
easily reference and use external components. That is, you have a world of tools
available to you, and all you must do to take advantage of them is set a
reference to the component within your application, figure out the object model
for the component, and write the code. This article discusses the issues
involved in creating external components using VB6, from the perspective of an
Office developer. Find Part II
here, and Part III
here. (Apr/May/Jun 1999)
INI Files Exposed--An Object Model for Working with INI Files (VBA/VB6): We
know that Microsoft has deemed the lowly INI (initialization) file to be dead,
yet we all know that sooner or later, we need to read or write from one as part
of some application. Sure, we know better. We've been indoctrinated to use the
Windows registry instead, but INI files are so simple, so safe, so comfortable.
To be honest, although using INI files is simple, reading and writing from them
programmatically is something of a pain. It requires a bunch of API functions -
simple ones to be sure, but they still require those pesky declarations. This
article (and its successor) discuss a class or two that make it easy to work
with INI files. Find Part II
here. (Jan/Feb 1999)
Resolving Class Envy--Creating a ScreenInfo Class (VBA/VB6): When you switch
development environments often, working one day in Visual Basic 6.0 (VB6) and
the next in Excel 2000, for example, you may find yourself suffering from a true
cognitive dissonance: built-in objects you used yesterday in VB6 simply don't
exist in Office's implementation of VBA. This happened to us recently when
working on a project that required both Office and VB6. We grew comfortable
using the Screen object in Visual Basic, which allowed us to retrieve
information about the user's environment, and required the same functionality
when working in Access and Excel. Among other things, we needed to know how big
the screen was, and what fonts were available. This article introduces a
ScreenInfo class you can use whether in VBA or in VB6, giving you much more
information than VB6's limited Screen class. (Dec 1998)
Playing with Tag--When New Properties aren't Allowed (VBA/VB6): If you work
with controls for long, sooner or later, you'll want to create a new property
for an object that doesn't allow you to create new properties. For example, you
may need to add a LastModified property to a TextBox control so you can keep
track of when it was last modified. Or, you may want to add a Value property to
a Frame control in VB6, tracking the selected option button contained within the
frame. You can add values to the Tag property, but doing so makes it impossible
to add more than one such property. The class provided in this article allows
you to add multiple user-defined properties in the Tag property. (Nov 1998)
Deconstructing QueryDef: Part I (Looking at QueryDef Objects in a Different Way)
(Access): While working on a project, Ken needed to parse and recreate Access
queries. All the information you need is there, in the system tables, but it's
totally undocumented. Beginning in this article and continuing in the next, Ken
describes the QueryInfo class, which retrieves all the bits and pieces
describing a query, given the information in the system tables. Find Part II
here, and Part III
here. (Jun/Jul/Aug 1998)
Call Me Back--Using Callbacks with the Windows API (VBA before Office 2000): Programmers
using the Windows API from VBA have always faced a handicap when compared with C
programmers: VBA has never supported function pointers. Why should we care? We
should care because many Windows API functions require you to tell Windows the
address of a function to call, to satisfy information the API function needs. C
programmers have always been able to pass the address of a function around as a
long integer value, but VBA programmers haven't been able to do this. This
article describes how you can do this, using some undocumented tricks. (Note:
Office 2000 added the AddressOf operator, making this information unnecessary.)
(May 1998)
Push, Pop, and Peek--Creating Stacks and Queues with VBA (VBA/VB6):
Once you get past the point of writing applications that manipulate the user
interface, you'll soon want to be able to store data in memory as your
application is running. You may want to keep track of items selected by a user
in the order selected, or you may need to track usage of forms in your
application. In any case, you may need to create an ordered data structure in
memory, and VBA's class modules make this easier than you might expect. (Apr
1998)
Deep into the API--Retrieving Screen and Window Information (VBA/VB6):
Windows provides a great deal of information about the screen and the objects
displayed on the screen, such as icons and windows. Retrieving and setting that
information, however, can be somewhat tedious. If you want to find out the size
of the screen your application is running on, or if you want to modify the
maximized window size, you'll have to dig deep into the Windows API. If you need
to use these features, one solution is a wrapper class that hides all the
details from the programmer using the information. This article discusses a
class that provides this functionality for you. (Feb 1998)
Keyboard Class--From Windows API Chaos to VBA Class Module Calm (VBA/VB6):
Wouldn't it be nice if you had a simple Keyboard object that supplied properties
to perform all the work for you, rather than having to muck with the Windows API
directly? Of course it would! That's where this article is headed. The Windows
API provides a lot of information about the keyboard, but retrieving it requires
calling a number of functions, so you have to know which functions to call, how
to call them, what information they return, and more. (Dec 1997)
Columns
Backwords Columns: Believe it or not, Informant Publications allowed
Ken to publish 1000 words on any topic (loosely associated with Office
development) for a few years. Some people found the column amusing. You can
judge for yourself.
Seinfeld, Bathroom Tile, Y2K, and Me! (Aug 1998)
The Big Easy, Hurricanes, and Some "Don'ts" (Sep 1998)
Logan Airport, Los Angeles, and Worry-Free Roaming (Oct 1998)
All Things Not Being Equal (Nov 1998)
Dodging and Rounding (Dec 1998)
Never Leave Home Without It (Jan 1999)
Golden Rule and Internationalization (Feb 1999)
In Praise of the Absurd (Mar 1999)
Developers in Love (Apr 1999)
Office 2000 Developer: All of That? (May 1999)
Consistent Environments? Not in this Century (Jun 1999)
Old Dog, New Tricks (July 1999)
Everyone Has to Come from Somewhere (Aug 1999)
An American in Amsterdam (Sep 1999)
The Right Sizing Function (Oct 1999)
Justifying Your Code at the Pearly Gates (Nov 1999)
Self-Destructing Software (Dec 1999)
Myths and Mysteries (Jan 2000)
What Were They Thinking? (Feb 2000)
Under-Engineering Doesn't Cut it in the Long Run (Mar 2000)
The Right Way, and the Wrong Way (Apr 2000)
What's the Buzz with XML? (May 2000)
Working with Illogical Operators (Jun 2000)
How Rudolph Made Me Stupid (Jul 2000)
Learning New Things in the UK (Aug 2000)
The Quest for World DOMination (Sep 2000)
Doing What You're Told (Oct 2000)
How the Banana Royale Got Its Revenge (Nov 2000)
Fickle Finger of Fate (Dec 2000)
What Will They Buy Next? (Jan 2001)
Being Part of Something Important (Feb 2001)
Do You .NET? (Mar 2001)
Regular Expressions to the Rescue (Apr 2001)
Office XP, .NET, VSA, etc. (Jun 2001)
My Visit with Shamu (Jul 2001)
I'm Mad as Hell and I'm Not Going to Take it Anymore (Aug 2001)
Bush-Bashing Down Under (Sep 2001)
Becoming Shiftless (Oct 2001)
Collapsing Things (Nov 2001)
Moving On (Dec 2001)
Read about Optimizing
VBA. Check out this article by Ken Getz and posted to the Microsoft Access
Developer Web site on how to make your VBA code run as fast as it can. From a talk at the
Microsoft Office and VBA Solutions Conference.
Read about ADO
Programming. Check out this article on ActiveX Data Objects (ADO) by Paul
Litwin, originally from "Intranet & Web Databases For Dummies".
Posted on Microsoft's Web site from a talk at the Microsoft Office and VBA
Solutions Conference.
Read "Class
Modules: Simplify and Accelerate Your Development Process" by Ken Getz
and Mike Gilbert from "Microsoft Office and VBA Developer" (Informant
Publications). Posted on Microsoft's Web site.
Read excerpts on application
internationalization from "Microsoft Access 95 How-To" (Ken Getz
and Paul Litwin) from Waite Group Press. Posted on Microsoft's Web site.
Last Updated on 01/15/2003.