ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing an application or website / Controls, windows and pages / Controls: Available types / OLE control
  • Overview of OLE control
  • WINDEV and OLE controls
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Overview of OLE control
The OLE control allows you to handle an OLE object.
Reminder: OLE is a protocol for exchanging data and commands whose principle consists in embedding and linking objects. The Client/Server connection is established as soon as the embedded object is opened.
An OLE object is a file containing:
  • the reference of the OLE server that created the object
  • the object itself (image, document...).
Technically speaking, an OLE object encapsulates data containing text, images, sounds... Data encapsulation in OLE objects enables these objects to be exported without knowing anything about their structure.
To create an OLE control:
  1. On the "Creation" tab, in the "Other controls" group, click "OLE".
  2. Click at the desired location to create the control.
To view the characteristics of the control, select "Description" in the context menu.
WINDEV and OLE controls
WINDEV is an OLE client. The applications developed in WINDEV request the data, display and store the OLE objects.
The OLE servers provide the objects to the clients that request them. These objects can be PaintBrush, Excel, WinWord...
As a client, WINDEV supports the OLE objects. It is used to:
  • draw an object in an OLE control. An object can be an Excel worksheet, a Paint Brush graphic image...
  • edit an OLE object in an OLE control. The OLE object can be:
    • chosen in the editor or by programming.
    • defined according to a server or to a base file.
Remarks:
  • In programming, an OLE control is handled by specific functions. WINDEV is not an OLE server.
  • OLE version 1 and OLE version 2 are supported (the later versions are not supported).
  • An OLE object cannot be printed in WINDEV. The object is updated upon request.
  • An OLE control can contain a single OLE object.
Related Examples:
WD Controlling Excel Training (WINDEV): WD Controlling Excel
[ + ] This example explains how to control Excel via OLE Automation.
All the features included in Excel can be emulated.

This example requires Excel 97 or later.

Summary of the example supplied with WINDEV:
Controlling a spreadsheet as Excel may be useful to allow the user to keep his own habits from the software powered by WINDEV.
This process is very easy via the "CExcel" class supplied with WINDEV.
The main features of Excel can be directly called (chart, inserting objects, sorts, ...).
How do I control Excel via OLE Automation?
An OLE Automation contains methods and properties. This allows you to emulate it directly in WLanguage.
For example, to display the selected cell in bold:
MyOLEAutomationObject>>Selection>>Font>>Bold = True
WD Controlling Word Training (WINDEV): WD Controlling Word
[ + ] This example explains how to control Word via OLE Automation.
All the features included in Word can be emulated.
This example is compatible with the versions 97, 2000 and 2002 (XP) of Word.
Summary of the example supplied with WINDEV:
Controlling a text processor as Word may be useful to allow the user to keep his own habits from the software powered by WINDEV.
This process is very easy via the "CWord" class supplied with WINDEV.
The main features of Word can be directly called (text formatting, inserting objects, mailshot, and so on).
How do I control Word via OLE Automation?
An OLE Automation contains methods and properties. This enables you to emulate it directly in WLanguage.
For example, to write the selected text in bold:
MyOLEAutomationObject>>Selection>>Font>>Bold = True
WD Controlling Outlook Training (WINDEV): WD Controlling Outlook
[ + ] This program, powered by WINDEV, is used to read and write in the Outlook folders:
- Email
- Calendar
- Contacts
- Tasks
- Notes

An OLE dialog is used to read and write data in the Outlook files.
Note: We will be using the Outlook software supplied with the later versions of MS-Office. The software used is not "Outlook express".

"WD Controlling Outlook" also presents an example for using the WINDEV databinding between the variables found in the code and in the controls.

This example also presents the OOP (Object-Oriented Programming) and the UML diagrams.
Minimum version required
  • Version 9
Comments
Click [Add] to post a comment

Last update: 06/23/2023

Send a report | Local help