CONTENTS
Section II
ACT! OLE Application Object
Chapter 1
Getting Started with the OLE Application Object......................................
195
Conventions used in this section.........................................................................
196
Syntax
conventions......................................................................................
196
Terminology................................................................................................
196
Parameter types................................................................................................
197
Special considerations.......................................................................................
197
Using properties in Visual C++......................................................................
198
Changing the focus......................................................................................
198
System requirements.........................................................................................
198
Development languages......................................................................................
198
Using the Application Object with Visual C++.................................................
198
Example C++ code......................................................................................
199
Understanding key files......................................................................................
200
ACT! OLE Application Object model....................................................................
201
What’s new.......................................................................................................
202
Changes for ACT! 4.0...................................................................................
202
Changes for ACT! 2000.................................................................................
204
Changes for ACT! 2000 version 5.0.2.............................................................
205
Chapter 2
Using Application Object Properties and Methods..................................
207
Common properties and methods........................................................................
208
Activate Method...........................................................................................
209
Active Property............................................................................................
210
Application Method......................................................................................
210
Caption Property..........................................................................................
210
ClearError Method (requires ACT! 4.0 or later).................................................
211
Close Method..............................................................................................
211
CurrentFieldId Method (requires ACT! 2000 or
later)......................................... 212
CurrentRecord Method (requires ACT! 2000 or
later)........................................ 212
Displayed Property......................................................................................
213
GetLastError Method....................................................................................
213
GetMode Method (requires ACT! 2000 or later)...............................................
214
HasRecordChanged Method (requires ACT! 2000 or
later)................................ 215
LookupKeyword Method (requires ACT! 2000 or
later)...................................... 215
Maximize Method........................................................................................
216
Minimize Method.........................................................................................
216
Name Property............................................................................................
217
Parent Method.............................................................................................
217
ReSize Method............................................................................................
217
Show Method..............................................................................................
218
Type Property..............................................................................................
219
Update Method............................................................................................
219
ViewState Property (requires ACT! 2000 or later)............................................
220
Application object properties and methods...........................................................
221
ActVersion Property (requires ACT! 2000 or
later)........................................... 223
AddUser Method..........................................................................................
224
BackupDB Method (requires ACT! 4.0 or later)................................................
225
Caption Property..........................................................................................
225
ChangePassword Method.............................................................................
226
ClearError Method (requires ACT! 4.0 or later).................................................
227
CloseDB Method.........................................................................................
227
Command Method.......................................................................................
227
CompressDB Method...................................................................................
228
GetActiveDB Method (not currently implemented)...........................................
228
GetAppName Method...................................................................................
229
GetAppPath Method....................................................................................
229
GetCurrentUserName Method (requires ACT! 4.0 or
later)................................ 230
GetLastError Method....................................................................................
230
GetOpenDBName Method............................................................................
230
GetPosition Method.....................................................................................
231
GetSize Method..........................................................................................
232
GetUserId Method........................................................................................
232
GetUserPrivilege Method..............................................................................
233
GetVersion Method (requires ACT! 4.0 or later)...............................................
233
Help Method................................................................................................
234
IsDBOpen Method.......................................................................................
234
IsVisible Method..........................................................................................
234
LastContactListModTime Property.................................................................
235
Maximize Method........................................................................................
235
Minimize Method.........................................................................................
235
OpenDB Method..........................................................................................
236
OpenFile Method.........................................................................................
236
Preferences Method.....................................................................................
237
ProcessFile Method.....................................................................................
237
PurgeHistories Method.................................................................................
238
PurgeNotes Method.....................................................................................
238
PurgeTransactions Method...........................................................................
239
ReIndexDB Method......................................................................................
240
RemoveOutlookActivities Method (requires ACT!
2000 or later)......................... 241
ReSize Method............................................................................................
241
RestoreDB Method (requires ACT! 4.0 or later)...............................................
242
RunMacro Method.......................................................................................
242
SaveCurrentLookup Method..........................................................................
243
SendKey Method.........................................................................................
243
Show Method..............................................................................................
244
Update Method............................................................................................
245
UpdateOutlookActivities Method (requires ACT!
2000 or later).......................... 245
Views Method.............................................................................................
246
CalendarView object methods.............................................................................
247
GetActiveMonth Method...............................................................................
248
GetCalendarMode Method............................................................................
248
SetActiveMonth Method...............................................................................
249
SetCalendarMode Method............................................................................
249
ContactListView object methods.........................................................................
250
AddNewContact Method (obsolete)................................................................
250
AddNewContactEx Method (requires ACT! 4.0 or
later).................................... 250
GetGrid Method...........................................................................................
251
ContactView object methods..............................................................................
253
Activities Method.........................................................................................
255
AddContactToGroup Method.........................................................................
255
AddNewActivity Method (obsolete)................................................................
256
AddNewActivityEx Method (requires ACT! 4.0 or
later)..................................... 257
AddNewContact Method...............................................................................
258
AddNoteHistory Method (obsolete)................................................................
259
AddNoteHistoryEx Method (requires ACT! 4.0 or
later).................................... 259
AttachFile Method (requires ACT! 4.0 or later)................................................
261
BOL Method................................................................................................
261
CompleteSale Method (requires ACT! 2000 or
later)........................................ 262
CreateLookup Method (requires ACT! 2000 or
later)......................................... 263
CreateSalesForecast Method (requires ACT! 2000
or later).............................. 263
Delete Method.............................................................................................
264
DeleteContactFast Method (requires ACT! 2000 or
later).................................. 265
EOL Method................................................................................................
265
GetActiveGroup Method...............................................................................
266
GetActiveGroupName Method.......................................................................
267
GetActiveTab Method...................................................................................
268
GetCount Method........................................................................................
269
GetCurrentID Method...................................................................................
269
GetField Method..........................................................................................
270
GetTabCount Method (requires ACT! 4.0 or later)............................................
270
GetTabName Method (requires ACT! 4.0 or later)............................................
271
Goto Method...............................................................................................
272
GroupMembership Method............................................................................
272
LookupAll Method........................................................................................
273
LookupField Method (obsolete).....................................................................
273
LookupFieldEx Method (requires ACT! 4.0 or
later).......................................... 273
LookupMyRecord Method.............................................................................
275
LookupPrevious Method...............................................................................
275
MoveFirst Method........................................................................................
275
MoveLast Method........................................................................................
276
MoveNext Method........................................................................................
276
Moveprevious Method...................................................................................
276
NewContactDialog Method (requires ACT! 4.0 or
later)..................................... 277
NotesHistory Method...................................................................................
277
RunQuery Method........................................................................................
277
Sales Method (requires ACT! 2000 or later)....................................................
278
SaveQuery Method......................................................................................
279
SelectContactDlg Method (requires ACT! 4.0 or
later)...................................... 279
SetActiveGroup Method................................................................................
280
SetActiveGroupName Method (requires ACT! 4.0 or
later)................................ 281
SetActiveTab Method...................................................................................
281
SetField Method..........................................................................................
281
TriggerActivitySeries Method (requires ACT! 2000
or later)............................... 282
EmailView object methods.................................................................................
284
GetActiveInbox Method................................................................................
284
GetInboxCount Method.................................................................................
285
GetInboxName Method.................................................................................
285
GetOpenFolderMessageCount Method (requires ACT!
2000 or later)................. 286
MsgComposeView Method...........................................................................
286
OpenInbox Method.......................................................................................
287
SetActiveInbox Method.................................................................................
287
Sort Method (requires ACT! 2000 or later).......................................................
288
ExplorerView object methods..............................................................................
289
GetStartupURL Method................................................................................
290
GetURL Method...........................................................................................
290
GoBack Method..........................................................................................
290
GoForward Method......................................................................................
291
Refresh Method...........................................................................................
291
SetURL Method...........................................................................................
291
Stop Method...............................................................................................
292
Grid object methods...........................................................................................
293
BOL Method................................................................................................
294
DeleteRow Method.......................................................................................
295
EOL Method................................................................................................
295
GetColumnCount Method.............................................................................
296
GetColumnID Method...................................................................................
297
GetColumnName Method.............................................................................
298
GetCurrentRow Method................................................................................
299
GetField Method..........................................................................................
299
GetFilter Method (requires ACT! 4.0 or later)...................................................
300
GetLastError Method....................................................................................
302
GetRowCount Method..................................................................................
302
GetRowNumber Method...............................................................................
303
GetUniqueID Method....................................................................................
303
Goto Method...............................................................................................
303
MoveFirst Method........................................................................................
304
MoveLast Method........................................................................................
304
MoveNext Method........................................................................................
305
Moveprevious Method...................................................................................
305
RefreshGrid Method.....................................................................................
305
SelectRow Method.......................................................................................
306
SetField Method..........................................................................................
306
SetFilter Method (requires ACT! 4.0 or later)...................................................
307
Sort Method................................................................................................
308
GroupView object methods.................................................................................
309
Activities Method.........................................................................................
310
AddMemberToGroup Method........................................................................
311
AddNew Method..........................................................................................
312
AddNewSubGroup Method (requires ACT! 2000 or later)..................................
313
AddNote Method (obsolete)..........................................................................
314
AddNoteEx Method (requires ACT! 4.0 or later)...............................................
314
AttachFile Method (requires ACT! 4.0 or later)................................................
315
BOL Method................................................................................................
316
ChangeToParentGroup Method (requires ACT! 2000 or later)............................
316
ChangeToSubGroup Method (requires ACT! 2000 or later)................................
317
Collapse Method (requires ACT! 2000 or later)................................................
317
ContactMembers Method.............................................................................
318
Delete Method.............................................................................................
319
DeleteGroupFast Method (requires ACT! 2000 or later)....................................
319
EOL Method................................................................................................
319
Expand Method (requires ACT! 2000 or later)..................................................
320
GetActiveTab Method...................................................................................
320
GetCount Method........................................................................................
321
GetCurrentID Method...................................................................................
322
GetField Method..........................................................................................
323
GetSubGroupCount Method (requires ACT! 2000 or later)................................
323
GetTabCount Method (requires ACT! 4.0 or later)............................................
324
GetTabName Method (requires ACT! 4.0 or later)............................................
324
Goto Method...............................................................................................
324
GroupType Method (requires ACT! 2000 or later).............................................
325
IsExpanded Method (requires ACT! 2000 or later)............................................
325
LookupAll Method........................................................................................
326
LookupField Method (obsolete).....................................................................
326
LookupFieldEx Method (requires ACT! 4.0 or later)..........................................
326
LookupPrevious Method...............................................................................
327
MoveFirst Method........................................................................................
327
MoveLast Method........................................................................................
328
MoveNext Method........................................................................................
328
Moveprevious Method...................................................................................
329
NotesHistory Method...................................................................................
329
RunQuery Method........................................................................................
329
SaveQuery Method......................................................................................
330
SetActiveTab Method...................................................................................
331
SetField Method..........................................................................................
331
MailComposeView object methods......................................................................
333
AddAttachment Method................................................................................
334
AddBccRecepient Method (requires ACT! 2000 or later)...................................
335
AddCcRecepient Method (requires ACT! 2000 or later)....................................
336
AddRecepient Method..................................................................................
336
ClearAll Method...........................................................................................
336
ClearAttachments Method............................................................................
337
ClearBodyText Method.................................................................................
337
ClearRecepients Method..............................................................................
337
ClearSubject Method....................................................................................
338
Send Method...............................................................................................
338
SetBodyText Method...................................................................................
338
SetSubject Method......................................................................................
339
Preferences object properties and methods..........................................................
340
AttachMsgToContact Property (requires ACT! 4.0
or later)............................... 343
AttachToMsgUsing Property (requires ACT! 4.0 or later)..................................
344
CalendarStartTime Property..........................................................................
345
CalendarWeekStartsOn Property..................................................................
345
CalMinDurationForBanner Property (requires ACT! 4.0 or later).........................
346
CheckScheduleConflicts Property.................................................................
348
ClearError Method (requires ACT! 4.0 or later).................................................
349
ContactSalutation Property (requires ACT! 4.0 or later)....................................
349
DefaultContactLayout Property......................................................................
350
DefaultGroupLayout Property........................................................................
351
DisplayCountryCode Property.......................................................................
352
EnableSpeedLoader Property (requires ACT! 4.0 or later).................................
353
ExitPrompt Property....................................................................................
354
GenerateSynchReport Property (requires ACT! 4.0 or later)..............................
355
GetActivityCleanupStyle Method...................................................................
355
GetAttachmentInfo Method (requires ACT! 4.0 or later)....................................
356
GetCalendarIncrements Method....................................................................
356
GetDataToSynch Method (requires ACT! 4.0 or later)......................................
357
GetDBMaintReminderInfo Method (requires ACT! 2000 or later)........................
358
GetDefaultApplication Method.......................................................................
359
GetDefaultLocation Method...........................................................................
359
GetEmailInboxSettings Method.....................................................................
360
GetEmailNewMsgInfo Method.......................................................................
361
GetEmailSystem Method (requires ACT! 4.0 or later)......................................
362
GetLastError Method (requires ACT! 4.0 or later).............................................
362
GetNameSettings Method............................................................................
362
GetSchdActivityDefaults Method...................................................................
363
GetSchdAutoRollover Method.......................................................................
365
GetStyle Method.........................................................................................
366
GetSynchSchedule Method (obsolete)...........................................................
366
GetSynchScheduleInfo Method (requires ACT! 4.0 or later)..............................
367
GetSynchSettings Method............................................................................
368
GetSynchUpdateInfo Method (requires ACT! 4.0 or later).................................
368
NewActivitiesPrivate Property........................................................................
369
NewActivitiesSeparate Property (requires ACT! 4.0 or later).............................
370
NewContactsPrivate Property........................................................................
371
NewGroupsPrivate Property..........................................................................
372
PromptToPrintEnvelope Property (requires ACT! 4.0 or later)............................
373
ReceivedSynchLocation Property (requires ACT! 4.0 or later)...........................
374
RememberPassword Property.......................................................................
374
RemindToBackup Property (requires ACT! 4.0 or later)....................................
375
ReturnReceipt Property (requires ACT! 4.0 or later).........................................
376
SecondGroupColumn Property......................................................................
377
SetActivityCleanupStyle Method...................................................................
377
SetAttachmentInfo Method (requires ACT! 4.0 or later)....................................
378
SetCalendarIncrements Method....................................................................
380
SetDataToSynch Method (requires ACT! 4.0 or later).......................................
381
SetDBMaintReminderInfo Method (requires ACT! 2000 or later)........................
382
SetDefaultApplication Method.......................................................................
383
SetDefaultLocation Method...........................................................................
384
SetEmailInboxSettings Method.....................................................................
385
SetEmailNewMsgInfo Method.......................................................................
386
SetEmailSystem Method (requires ACT! 4.0 or later).......................................
387
SetNameSettings Method.............................................................................
388
SetSchdActivityDefaults Method...................................................................
389
SetSchdAutoRollover Method........................................................................
391
SetStyle Method..........................................................................................
392
SetSynchSchedule Method (obsolete)...........................................................
393
SetSynchScheduleInfo Method (requires ACT! 4.0 or later)..............................
394
SetSynchSettings Method............................................................................
395
SetSynchUpdateInfo Method (requires ACT! 4.0 or later)..................................
395
ShowContactParsingDialog Property (requires ACT! 2000 or later)....................
397
ShowCurrentMonthOnly Property..................................................................
397
StartupDatabase Property............................................................................
398
StartupMacro Property.................................................................................
399
TabNavigation Property.................................................................................
400
UseAct20Keys Property...............................................................................
401
UseDialer Property (not currently implemented)..............................................
402
UseLastDBonStartup Property......................................................................
402
UseTypeahead Property (requires ACT! 4.0 or later)........................................
403
WaitTime Property (requires ACT! 4.0 or later)................................................
404
TaskListView object methods.............................................................................
406
AddNewActivity Method (obsolete)................................................................
406
AddNewActivityEx Method (requires ACT! 4.0 or later).....................................
406
GetGrid Method...........................................................................................
408
Views object property and methods.....................................................................
409
Application Method......................................................................................
410
ClearError Method (requires ACT! 4.0 or later).................................................
410
CloseAll Method..........................................................................................
410
Count Property............................................................................................
411
Create Method.............................................................................................
411
CreateBrowserView Method (requires ACT! 2000 version 5.0.2 or later).............
412
CreateBrowserViewFromUrl Method (requires ACT! 2000 version 5.0.2 or later)..
413
CreateEx Method (requires ACT! 2000 or later)...............................................
413
FindExplorerView Method (requires ACT! 4.0 or later)......................................
414
GetActive Method........................................................................................
415
GetLastError Method....................................................................................
416
GetView Method..........................................................................................
416
GetViewEx Method (requires ACT! 2000 version 5.0.2 or later).........................
417
Chapter 3
OLE Application Object Error Codes.........................................................
419
CHAPTER
Getting Started with the OLE Application Object
This section consists of three chapters that describe the ACT!TM OLE Application Object component of the ACT! Software Development Kit (SDK). The ACT! OLE Application Object provides third-party applications with both control and context interrogation of ACT! It is intended for use by both ACT! add-on product developers and enterprise product developers who need to tightly integrate ACT! into a larger end-user solution. A comprehensive set of methods and properties is included to control the application frame window, the current view, get or set view grid cells, set application preferences, and more.
Using the ACT! OLE Application Object, third-party application developers can minimize development time and ensure better compatibility in the future by employing the parts of the ACT! user interface exposed by the OLE Application Object to create new ACT! contacts, insert notes or activities, and manage database maintenance operations. Additionally, the OLE Application Object allows third-party applications to determine the current context of ACT! (current view, displayed contact or contact group, and so on) as controlled by the user, so that their functionality is more synchronous with the current ACT! UI views.
To use this section, you need to be familiar with and using the following:
· ACT! for Windows, version 3.0.7 or later
· Microsoft Windows 95, Windows 98, Windows 2000, or Windows NT 4.0
· Microsoft Visual Basic, version 4.0 or later, or Microsoft Visual C++ 4.0 or later
Microsoft Visual Basic for Applications can be used as an alternative development language to access data in Microsoft Access and Excel versions in Microsoft Office 95, and Microsoft Access, Excel and Word versions in Microsoft Office 97 through Office 2000.
This section provides syntax conventions and terminology used in this section.
bold Command names, function names, properties, methods, and other text you need to type are shown in bold.
ALL CAPITALS File names and messages are shown in all CAPITAL letters.
Courier Example code is shown in a monospaced Courier font. Comments in the code are preceded by an apostrophe ('Comment). If a line of code does not fit on a single line of the page, the remaining code is indented on the next line. Code examples are not case sensitive.
italic Parameters, return variables, data structure names, and text that represent the type of text to be entered rather than a literal series of characters are shown in italic.
[brackets] Optional items in syntax statements are enclosed in brackets ([ ]). For example, [password] indicates that a password can be used with the command, but is not required. In commands, include the information within the brackets without the brackets.
Parameter1|Parameter2 Parameters are separated by a vertical bar (|) to indicate a mandatory choice between two items. Only one of the items can be specified.
... Items that you can repeat are indicated by an ellipsis (… ) For example, devicename [...] indicates that you can optionally specify more than one device, separating the device names with a space.
ACT! database The term database, in relation to an ACT! database, refers to the set of tables and their associated indexes in an ACT! database.
Table The term table refers to a specific table in an ACT! database.
The following table lists the data types that are referenced in this section. Parameter names follow Hungarian notation, beginning with a lowercase letter or letters that indicate the data type.
|
Parameter syntax |
Data type |
|
date |
Date and time in Short Date style and Time style from Windows Regional Settings (DATE in Visual C++) |
|
fParameter |
Float (Single in Visual C++) |
|
iParameter |
Short integer |
|
lParameter |
Long integer |
|
szString |
String, terminated by a null character (BSTR in Visual C++) |
|
True|False or |
Boolean |
|
vParameter |
Variant (VARIANT in Visual C++) |
When creating an application using the ACT! OLE Application Object, keep the following in mind:
·
ACT! must have been started at least once after ACT! is installed
to update the registry entries for the Application Object.
· ACT! itself is executed when the object is instantiated but its UI can be hidden through an OLE Application Object method if desired. If you hide the ACT! user interface, the ACT! user interface might reappear after an exception condition (such as a confirmation message following the deletion of a record or a lookup failure).
· If a client application starts ACT! or ACT! is running when the client application starts and the user selects Exit from the File menu, ACT! is hidden, but not closed. ACT! does not close until the client application releases control of ACT! by either closing ACT! or exiting.
· If you need to use the OLE Application Object from more than one location in your program, define the Application object as a global variable. This enables you to access the Application Object from many locations in your program and reduces execution time by creating an Application object one time instead of once every time it is needed.
For each property, the ACT! Application Object creates corresponding sets of Get and Set methods in an MFC wrapper class. Read-only properties, however, have only a Get method. If you are using Visual C++, check the C++ header file generated by Visual C++ (ACT.H) for the methods that correspond to properties documented in this manual.
When you are developing a third-party application using the OLE Application Object, keep in mind that some functions within the Application Object set the focus to ACT! to keep ACT! as the foreground application. ACT! requires the focus to perform actions such as receiving Windows messages or using data stored in lists inside the application. Code needs to be added to a third-party application to bring it to the foreground as soon as it is done interacting with the OLE Application Object.
Before you use the ACT! OLE Application Object, you should have the following applications already installed on your computer:
· ACT! for Windows, version 3.0.7 or later. We recommend using the latest update. To receive an update, choose ACT! Update from the Help menu.
· Microsoft Windows 95, Windows 98, Windows 2000, or Windows NT 4.0
Many programmers who work with the OLE Application Object work with Microsoft Visual Basic. Hence, most of the examples in the documentation of the application object are designed for the Visual Basic programmer. However, a type library is supplied and consequently, the integrated development environment (IDE) of Microsoft Visual C++ can be used to automatically generate prototypes for the object methods.
The following basic steps can help you get started using ACT! automation libraries using Microsoft Visual C++ 4.0 or later and Microsoft Foundation Class (MFC) library. To use the OLE Application Object in an application written using Visual C++, you first need to first create a wrapper class around the OLE objects supported by the OLE Application Object.
To create a
wrapper class:
1 Create a new MFC project and enable OLE automation.
2 Open the class wizard and click Add Class.
3 Select the From Type Library option.
4 When prompted for the name of the type-library, choose ACT.TLB from the ACT! program files folder. The Confirm Classes dialog appears.
5 Click OK or select only those classes that you need, then click OK.
Visual C++ will automatically generate MFC wrapper classes for all methods and properties supported by the OLE Application Object.
For more information on how to use OLE automation in Visual C++, see Visual C++ online help.
|
//This example lists the current contact's name, address and phone number IActAppObj AppObj; IAIViews ViewsObj; IAIContactView ContactViewObj;
//Create a Dispatch pointer to the application object AppObj.CreateDispatch("ACTOLE.APPOBJECT", pException);
//Set your own caption AppObj.SetCaption("My Extended ACT!"); m_ListBox.ResetContent() if (AppObj.IsDBOpen ()) //If a database is open { //Attach the Views object LPDISPATCH viewsDispatch = AppObj.Views(); ViewsObj.AttachDispatch(viewsDispatch, TRUE);
//Attach the ContactView object LPDISPATCH CVDispatch = ViewsObj.Create(1,"CView"); ContactViewObj.AttachDispatch(CVDispatch, TRUE);
//List information about the current contact m_ListBox.AddString("Current Contact Information:"); m_ListBox.AddString(ContactViewObj.GetField(CF_Name) ); m_ListBox.AddString(ContactViewObj.GetField(CF_Title) ); m_ListBox.AddString(ContactViewObj.GetField(CF_Company) ); m_ListBox.AddString(ContactViewObj.GetField(CF_Phone) ); m_ListBox.AddString(ContactViewObj.GetField(CF_Address1) ); m_ListBox.AddString(ContactViewObj.GetField(CF_City) ); m_ListBox.AddString(ContactViewObj.GetField(CF_State) + " " + ContactViewObj.GetField(CF_Zip) ); m_ListBox.AddString(ContactViewObj.GetField(CF_Zip) );
//Release all Dispatch pointers ContactViewObj.ReleaseDispatch(); ViewsObj.ReleaseDispatch(); AppObj.ReleaseDispatch(); }
|
The following table lists key ACT! files used by the ACT! OLE Application Object. These files are stored in the ACT! program files folder.
|
File |
Description |
|
ACT.EXE |
The ACT! Application Object is contained within the executable file for the ACT! application. |
|
ACT.TLB |
Type library that contains functions within the ACT! OLE Application Object. Methods contained in the type library need to be used directly by Visual C++ developers. In Visual Basic type library functions are handled automatically at run time. |
|
ACTEVENT.OCX |
OLE event notification control module, used by third-party applications for receiving event notification. An event is generated, for example, when the contact is changed in the Contact View. |
|
ACTREG.EXE |
The ACT! Windows registry update utility. This utility can be run manually if necessary to register ACT! OLE controls as a troubleshooting procedure. |
The following table lists examples of properties and corresponding methods to use in Visual C++.
|
Property name |
Type |
C++ Method |
|
ContactView.Active |
Read Only |
ContactView.GetActive() |
|
Preferences.ExitPrompt |
Read/Write |
Preferences.GetExitPrompt() Preferences.SetExitPrompt() |
The following diagram shows the relationships of objects in the ACT! OLE Application Object model.
The ACT! OLE Application Object requires ACT! 3.0.7 or later. This section lists changes to the OLE Application Object for ACT! releases 4.0 or later.
The following methods have been modified for ACT! 4.0:
|
Object |
Modified Methods |
Change |
|
Application |
Command |
Many values for lCommandID parameter added |
|
Grid |
GetColumnCount |
Return value on failure changed from 100 to -1 |
|
Preferences |
GetEmailNewMsgInfo |
Return string
changed to: |
|
|
GetSchdActivityDefaults |
PopupFields returned item added |
|
|
GetSynchSchedule |
Return string
changed to: |
|
|
SetEmailNewMsgInfo |
The
szInfo parameter changed to: |
|
|
SetSchdActivityDefaults |
PopupFields parameter added |
|
|
SetSynchSchedule |
The szInfo parameter changed to: |
The following new properties and methods have been added for ACT! 4.0:
|
Object |
New Properties |
New Methods |
|
Common properties and methods |
|
ClearError |
|
Application |
|
AddUser |
|
ContactListView |
|
AddNewContactEx |
|
ContactView |
|
AddNewActivityEx |
|
Grid |
|
GetFilter |
|
GroupView |
|
AddNoteEx |
|
Preferences |
AttachMsgToContact |
ClearError |
|
TaskListView |
|
AddNewActivityEx |
|
Views |
|
ClearError |
The following new properties and methods have been added for ACT! 2000:
|
Object |
New Properties |
New Methods |
|
Common properties and methods |
ViewState |
CurrentFieldId |
|
Application |
ActVersion |
RemoveOutlookActivities |
|
ContactView |
¾ |
CompleteSale |
|
EmailView |
¾ |
GetOpenFolderMessageCount |
|
GroupView |
¾ |
AddNewSubGroup |
|
MailComposeView |
¾ |
AddBccRecepient |
|
Preferences |
ShowContactParsingDialog |
GetDBMaintReminderInfo |
|
Views |
¾ |
CreateEx |
The following methods have been modified for ACT! 5.0.2:
|
Object |
Modified Methods |
Change |
|
ContactView |
GetActiveGroup |
For versions of ACT! prior to ACT! 2000 version 5.0.2, these methods activate the Contact View upon return. For ACT! 2000 version 5.0.2 or later, these methods do not activate the Contact View. |
The following new methods have been added for ACT! 2000 version 5.0.2:
|
Object |
New Methods |
|
Views |
CreateBrowserView |
The syntax for the following methods has been corrected in this document for ACT! 2000 version 5.0.2:
|
Object |
Modified Methods |
Change |
|
ContactView |
AddRecepient |
Syntax corrected. Note: Use the exact specified spelling. |

CHAPTER
Using Application Object Properties and Methods
· Common properties and methods applying to more than one object
· Application object properties and methods
· CalendarView object methods
· ContactListView object methods
· ContactView object methods
· EmailView object methods
· ExplorerView object methods
· Grid object methods
· GroupView object methods
· MailComposeView object methods
· Preferences object properties and methods
· TaskListView object methods
· Views object property and methods
The descriptions for each object include one table of properties and one of methods (if applicable), followed by alphabetical descriptions of the combined properties and methods. The descriptions supply details and, in some cases, examples. Cross references are also given to other properties or methods in the same or another object. Where possible, the descriptions include error codes (in the heading GetLastError) that can be returned. Use the GetLastError method (described in “Common properties and methods”) to get the last error code for the object. Methods with a long integer or short integer return type return S_OK on success.
The following common properties and methods apply to the CalendarView, ContactListView, ContactView, EmailView, ExplorerView, GroupView, MailComposeView, and TaskListView objects.
Properties
|
Property name |
Parameter(s) |
Parameter type(s) |
Value type |
Access |
|
Active |
None |
¾ |
Boolean |
Read Only |
|
Caption |
[=szTitleBar] |
String/BSTR |
String/BSTR |
Read/Write |
|
Displayed |
None |
¾ |
Boolean |
Read Only |
|
Name |
[=szName] |
String/BSTR |
String/BSTR |
Read/Write |
|
Type |
None |
¾ |
Long Integer |
Read Only |
|
ViewState |
None |
¾ |
Short Integer |
Read/Write |
Methods
|
Method name |
Parameter(s) |
Parameter type(s) |
Return type |
|
Activate |
None |
¾ |
Boolean |
|
Application |
None |
¾ |
Object/LPDISPATCH |
|
ClearError |
None |
¾ |
Void |
|
Close |
None |
¾ |
Long Integer |
|
CurrentFieldId |
None |
¾ |
Short Integer |
|
CurrentRecord |
None |
¾ |
Long Integer |
|
GetLastError |
None |
¾ |
Long Integer |
|
GetMode |
None |
¾ |
Short Integer |
|
HasRecordChanged |
None |
¾ |
Boolean |
|
LookupKeyword |
szKeyword, |
String, |
Void |
|
Maximize |
None |
¾ |
Boolean |
|
Minimize |
None |
¾ |
Boolean |
|
Parent |
None |
¾ |
Object/LPDISPATCH |
|
ReSize |
iHeight, |
Short Integer, |
Long Integer |
|
Show |
True|False |
Boolean |
Long Integer |
|
Update |
None |
¾ |
Long Integer |
Description Activates the view by bringing it to the foreground. Returns True on success or False on failure.
Objects CalendarView, ContactListView, ContactView, EmailView, ExplorerView, GroupView, MailComposeView, TaskListView
Syntax object.Activate
Return type Boolean
GetLastError S_VW_NOT_FOUND
See also
Active, Displayed
Example
'This example
can be put into a function that has been passed only
'the Views
object – objViews. We assume in the main function that
'the GroupView object has already been created.
Dim objGrp1 as object
'Get the GroupView pointer.
Set objGrp1 = objViews.GetView(3)
'If the Group View is not visible, then make it visible.
If objGrp1.Displayed = False then
objGrp1.Show True
End If
'If the GroupView is not the active view, then make it the active view.
If objGrp1.Active = False then
objGrp1.Activate
End If
'Now any GroupView methods can be applied to manipulate the Group view.
'End the function
Set objGrp1 = Nothing
Description Returns True if the view is active or False if it is inactive or an error occurs. A view can be visible but inactive.
Objects CalendarView, ContactListView, ContactView, EmailView, ExplorerView, GroupView, MailComposeView, TaskListView
Syntax object.Active
Value type Boolean, Read Only
GetLastError S_VW_NOT_FOUND
See also Activate, Displayed, Show
Example See Activate method.
Description Returns a dispatch pointer to the Application object containing the view. The returned pointer can be used to control the Application object.
Objects CalendarView, ContactListView, ContactView, EmailView, ExplorerView, GroupView, MailComposeView, TaskListView
Syntax object.Application
Return type Object/LPDISPATCH
Description Gets and sets the text in the title bar for the view.
Objects CalendarView, ContactListView, ContactView, EmailView, ExplorerView, GroupView, MailComposeView, TaskListView
Syntax object.Caption [= szTitleBar]
Parameters szTitleBar A string that specifies the text in the title bar for the view. Omit this optional parameter to get the text in the title bar.
Value type String/BSTR, Read/Write
GetLastError S_VW_NOT_FOUND
Example
'This example
gives the Task List window a new title bar.
Dim objApp as object
Dim objViews as object
Dim objTaskView as object
'Initialize the Application object.
'This starts ACT! if it is not already running.
Set objApp = CreateObject("ACTOLE.APPOBJECT")
Set objViews = objApp.Views
Set objTaskView = objViews.Create (4,"TL")
'Change the text on the Task List title bar to "My Task View".
objTaskView.Caption = "My Task View"
'Close the Application object.
Set objApp = Nothing
ClearError Method (requires ACT! 4.0 or later)
Description Clears the last error.
Objects CalendarView, ContactListView, ContactView, EmailView, ExplorerView, GroupView, MailComposeView, TaskListView
Syntax object.ClearError
Return type Void
See also GetLastError
Description Closes the view. Returns S_ERROR on failure.
Objects CalendarView, ContactListView, ContactView, EmailView, ExplorerView, GroupView, MailComposeView, TaskListView
Syntax object.Close
Return type Long Integer
GetLastError S_VW_NOT_FOUND
CurrentFieldId Method (requires ACT! 2000 or later)
Description Returns the field ID of the field containing the cursor. See the ACT! Database File Formats Reference appendix for lists of field IDs and names (Field constants).
Objects ContactView, GroupView
Syntax
object.CurrentField
Return type
Short Integer
CurrentRecord Method (requires ACT! 2000 or later)
Description Returns the current Contact or Group record number and position for the lookup.
Objects ContactView, GroupView
Syntax
object.CurrentRecord
Return type
Long Integer
Example
'The following
sample enumerates all the contacts and their record numbers.
Set objViews = objApp.Views
Set objContactView = objViews.Create(1, "CL")
objContactView.MoveFirst
'Move through all the contacts.
For i = 1 To objContactView.GetCount
'Display the record number and the Contact name.
lstVerify.AddItem "Contact # " & objContactView.CurrentRecord &
" is : " & objContactView.GetField(CF_Name)
objContactView.MoveNext
Next i
Example
'The following
code enumerates the group and subgroup names and their
'record number positions in the current lookup.
'If a group tree is collapsed, it is expanded.
Set objViews = objApp.Views
Set objGrp = objViews.CreateEx(3, "GV",2)
objGrp.MoveFirst
'Go through all the groups.
For i = 0 To objGrp.GetCount - 1
'If the group tree is not expanded, expand it.
If objGrp.IsExpanded = False Then
objGrp.Expand
End If
'List the record number and group name.
List1.AddItem objGrp.CurrentRecord & " ---" & objGrp.GetField(GF_Name)
objGrp.MoveNext
Next i
Description Returns True if the view is visible or False if the view is not visible.
Objects CalendarView, ContactListView, ContactView, EmailView, ExplorerView, GroupView, MailComposeView, TaskListView
Syntax object.Displayed
Value type Boolean, Read Only
See also Activate, Active, Show
GetLastError S_VW_NOT_FOUND
Example See Activate method.
Description Returns a long integer representing the last error code for the object. For a list of error codes, see the following chapter.
Objects CalendarView, ContactListView, ContactView, EmailView, ExplorerView, GroupView, MailComposeView, TaskListView
Syntax object.GetLastError
Return type Long Integer
GetMode Method (requires ACT! 2000 or later)
Description Returns a short integer identifying the task that the Contact or Group form is currently used for. This method determines if the form is in data entry/browse mode, lookup by example mode, or replace fields mode. Operations on the view should be performed in data entry/browse mode.
Objects ContactView, GroupView
Syntax
object.GetMode
Return type
Short Integer
Comments
The following values are returned by this method:
|
Value |
Mode |
|
Value |
Mode |
|
0 |
None (for example, when a dialog box is open) |
|
3 |
Query |
|
1 |
Data Entry/Browse |
|
4 |
Replace Fields |
|
2 |
Layout |
|
|
|
Example
'The following
example verifies that the Contact view is in data entry/
'browse mode
before enumerating the contacts in the database.
Set objContactView = objViews.CreateEx(1, "CV", 1)
'If the mode is not 1 (not Data Entry/Browse)
If objContactView.GetMode <> 1 Then
Select Case objContactView.GetMode
Case 0
MsgBox "A dialog is open in ACT!, please close it and try again"
Case 2
MsgBox "The Layout Editor is open in ACT!, please close it and try
again"
Case 3
MsgBox "The Lookup by Example/Query is open in ACT!, please close it
and try again"
Case 4
MsgBox "Replace Fields is open in ACT!, please close it and try again"
End Select
Else
'Now enumerate all the contacts in the database.
objContactView.MoveFirst
For i = 1 To objContactView.GetCount
lstVerify.AddItem objContactView.GetField(CF_Name)
objContactView.MoveNext
Next i
End If
HasRecordChanged Method (requires ACT! 2000 or later)
Description Returns True if the user has changed the current Contact or Group record (without saving the record) or False if the current record has not been changed.
Objects ContactView, GroupView
Syntax
object.HasRecordChanged
Return type
Boolean
LookupKeyword Method (requires ACT! 2000 or later)
Description Looks up the keyword in the specified tables and displays the Lookup Keyword dialog containing the results.
Object ContactView, GroupView
Syntax
object.LookupKeyword
(szKeyword,
lTables, iLookupType, szGroupName)
Parameters szKeyword A string specifying the keyword.
lTables A long integer specifying the tables to be searched. This value is created by ORing together values that represent the tables.
Following is a list of the values for the lTables parameter:
|
Value |
Table |
|
Value |
Table |
|
1 |
Contact |
|
8 |
|
|
2 |
Activity |
|
16 |
Groups |
|
4 |
NoteHistory |
|
32 |
Sales |
iLookupType
A short integer specifying the lookup type.
Following is a list of the values for the iLookupType parameter:
|
Value |
Type |
|
Value |
Type |
|
0 |
All Records |
|
2 |
Current Lookup |
|
1 |
Current Record |
|
3 |
Selected Group |
szGroupName
If the lookup type is 3, specify a string containing the Unique ID of the selected
group, otherwise specify a blank group name.
Return type
Void
Example Set objViews = objApp.Views
Set objContactView = objViews.Create(1, "CL")
'Lookup keyword "SDK" in the Contact view in the Contact, Activities and
'Notes/History fields for contacts belonging to a group with Unique ID GUID
objContactView.LookupKeyword "SDK", 1 Or 2 Or 4, 3, GUID
Description Maximizes the view. Returns True on success or False on failure.
Objects CalendarView, ContactListView, ContactView, EmailView, ExplorerView, GroupView, MailComposeView, TaskListView
Syntax object.Maximize
Return type Boolean
GetLastError S_VW_NOT_FOUND
See also
Minimize, Show
Description Minimizes the view. Returns True on success or False on failure.
Objects CalendarView, ContactListView, ContactView, EmailView, ExplorerView, GroupView, MailComposeView, TaskListView
Syntax object.Minimize
Return type Boolean
GetLastError S_VW_NOT_FOUND
See also
Maximize, Show
Description Sets or gets the name of the view.
Objects CalendarView, ContactListView, ContactView, EmailView, ExplorerView, GroupView, MailComposeView, TaskListView
Syntax object.Name[=szName]
szName A string that specifies the name of the view. Omit this optional parameter to get the name of the view.
Value type String/BSTR, Read/Write
See also Caption
Description Returns a dispatch pointer to the Views object that contains this view. The returned pointer can be used to control the Views object.
Objects CalendarView, ContactListView, ContactView, EmailView, ExplorerView, GroupView, MailComposeView, TaskListView
Syntax object.Parent
Return type Object/LPDISPATCH
Description Sets the size of the view. The current position (Top Left) of the view remains unchanged. Returns S_ERROR on failure.
Objects CalendarView, ContactListView, ContactView, EmailView, ExplorerView, GroupView, MailComposeView, TaskListView
Syntax object.ReSize(iHeight, iWidth)
Parameters iHeight A short integer indicating the new height of the view.
iWidth A short integer indicating the new width of the view.
Return type Long Integer
GetLastError S_VW_NOT_FOUND
See also
Maximize, Minimize, Show
GetSize in the Application object
Example
'This example
resizes the view.
Dim objApp as object
'Initialize the Application object.
'This starts ACT! if it is not already running.
Set objApp = CreateObject("ACTOLE.APPOBJECT")
'Resize the view.
objApp.ReSize 500, 800
'Close the Application object.
Set objApp = Nothing
Description Hides or displays the view.
Objects CalendarView, ContactListView, ContactView, EmailView, ExplorerView, GroupView, MailComposeView, TaskListView
Syntax object.Show(True|False)
Parameters True|False Specify True to display the frame or False to hide it.
Return type Long Integer
GetLastError S_VW_NOT_FOUND
See also
Activate, Maximize, Minimize
Example
'This example
displays the application window.
Dim objApp as object
'Initialize the Application object.
'This starts ACT! if it is not already running.
Set objApp = CreateObject("ACTOLE.APPOBJECT")
'Open the database.
objApp.OpenFile C:\My Documents\ACT\Database\ACT5demo.dbf
'If the application is not visible, then display it.
If objApp.IsVisible = False then
objApp.Show (True)
End If
'Close the Application object.
Set objApp = Nothing
Description Returns the type of view. The property is set during creation of the view object using the Create method in the Views object.
Objects CalendarView, ContactListView, ContactView, EmailView, ExplorerView, GroupView, MailComposeView, TaskListView
Syntax object.Type
Value type Long Integer, Read Only
Comments This property returns one of the following values:
|
Value |
State |
|
Value |
State |
|
1 |
Contact view |
|
5 |
Calendar view |
|
2 |
Contact List view |
|
6 |
E-mail inbox view |
|
3 |
Group view |
|
7 |
Explorer view |
|
4 |
Task List view |
|
|
|
Example See the GetActive method in the Views object.
Description Redraws the view. Returns S_ERROR on failure.
Objects CalendarView, ContactListView, ContactView, EmailView, ExplorerView, GroupView, MailComposeView, TaskListView
Syntax object.Update
Return type Long Integer
GetLastError S_VW_NOT_FOUND
ViewState Property (requires ACT! 2000 or later)
Description Returns the current view’s display state.
Object CalendarView, ContactListView, ContactView, EmailView, ExplorerView, GroupView, MailComposeView, TaskListView
Syntax
object.ViewState
Value type
Short Integer, Read/Write
Comments This property returns one of the following values:
|
Value |
State |
|
Value |
State |
|
1 |
Normal |
|
3 |
Minimized |
|
2 |
Maximized |
|
4 |
Hidden |
See also CreateEx in Views object
The Application object provides functions to externally control the ACT! application. The following properties and methods apply only to the Application object. See “Common properties and methods” in this section for properties and additional methods that apply to the ContactView object.
Properties
|
Property name |
Parameter(s) |
Parameter type(s) |
Value type |
Access |
|
ActVersion |
None |
¾ |
String |
Read Only |
|
Caption |
[= szTitleBar] |
String/BSTR |
String/BSTR |
Read/Write |
|
LastContactListModTime |
None |
¾ |
Long Integer |
Read Only |
Methods
|
Method name |
Parameter(s) |
Parameter type(s) |
Return type |
|
AddUser |
szUserName, |
String, |
Long Integer |
|
BackupDB |
szZipFileFullPath, |
String, |
Long Integer |
|
ChangePassword |
szUserName, szOldPassword, szNewPassword |
String, |
Long Integer |
|
ClearError |
None |
¾ |
Void |
|
CloseDB |
None |
¾ |
Long Integer |
|
Command |
iCommandID |
Short Integer |
Long Integer |
|
CompressDB |
szDBName |
String |
Long Integer |
|
GetActiveDB |
None |
¾ |
Object/LPDISPATCH |
|
GetAppName |
None |
¾ |
String/BSTR |
|
GetAppPath |
None |
¾ |
String/BSTR |
|
GetCurrentUserName |
None |
¾ |
String/BSTR |
|
GetLastError |
None |
¾ |
Long Integer |
|
GetOpenDBName |
None |
¾ |
String/BSTR |
|
GetPosition |
lXPos, |
Long Integer, Long Integer |
Long Integer |
|
GetSize |
lWidth, lHeight |
Long Integer, Long Integer |
Long Integer |
|
GetUserId |
None |
¾ |
String/BSTR |
|
GetUserPrivilege |
None |
¾ |
Long Integer |
|
GetVersion |
iFor |
Short Integer |
String/BSTR |
|
Help |
[szHelpFile,
lContextID] |
String, |
Long Integer |
|
IsDBOpen |
None |
¾ |
Boolean |
|
IsVisible |
None |
¾ |
Boolean |
|
Maximize |
None |
¾ |
Long Integer |
|
Minimize |
None |
¾ |
Long Integer |
|
OpenDB |
szDBName |
String |
Object/LPDISPATCH |
|
OpenFile |
szDBName |
String |
Long Integer |
|
Preferences |
None |
¾ |
Object/LPDISPATCH |
|
ProcessFile |
szFilename, |
String, |
Long Integer |
|
PurgeHistories |
szDBName |
String |
Long Integer |
|
PurgeNotes |
szDBName |
String |
Long Integer |
|
PurgeTransactions |
szDBName |
String |
Long Integer |
|
ReIndexDB |
szDBName |
String |
Long Integer |
|
RemoveOutlookActivities |
iRemoveIn |
Short Integer |
Long Integer |
|
ReSize |
iHeight, |
Short Integer, |
Long Integer |
|
RestoreDB |
szSourceZipFile, |
String, |
Long Integer |
|
RunMacro |
szMacroName |
String |
Long Integer |
|
SaveCurrentLookup |
szFilename |
String |
Long Integer |
|
SendKey |
lParam1, |
Long Integer, Long Integer, Long Integer |
Long Integer |
|
Show |
True|False |
Boolean |
Long Integer |
|
Update |
None |
¾ |
Long Integer |
|
UpdateOutlookActivities |
iUpdateDirection, |
Short Integer, |
Long Integer |
|
Views |
None |
¾ |
Object/LPDISPATCH |
ActVersion Property (requires ACT! 2000 or later)
Description Returns a string that contains the version of the ACT! application. An example of a returned string is 5.0.0.175, where 5.0.0 is the version of ACT! (ACT! 2000) and 175 is the number of the build.
Object
Application
Syntax
object.ActVersion
Value type
String, Read Only
Description Adds a user with the specified password and security level to the open database, but does not verify that a My Record exists for the user. The database should not be open by the ACT! application or by another instance of OLE. The current user must have Administrator security level to add new users. Returns S_ERROR on failure.
Object Application
Syntax
object.AddUser(szUserName,
szPassword, iPrivilege)
Parameters szUserName A string representing the user name of the new user.
szPassword A string representing the password for the new user.
iPrivilege A short integer representing the privilege (security level) of the new user.
Following is a list of the values for the iPrivilege parameter:
|
Value |
Security level |
|
Value |
Security level |
|
0 |
Browse |
|
2 |
Administrator |
|
1 |
Standard |
|
|
|
Return type Long Integer
GetLastError
S_NO_DB, S_NO_SECURITY, S_NO_USER, S_NOT_PRIVILEGED, S_CREATE_NEWUSER
See also ChangePassword
Example
'This example
adds the user "Tim Kelly".
Dim objApp as object
'Initialize the Application object.
'This starts ACT! if it is not already running.
Set objApp = CreateObject("ACTOLE.APPOBJECT")
'Add the user "Tim Kelly" with a password "User"
'with privilege to browse only.
objApp.AddUser "Tim Kelly", "User", 0
'Close the Application object.
Set objApp = Nothing
BackupDB Method (requires ACT! 4.0 or later)
Description Backs up the current database to the specified zip file name and location. Returns S_ERROR on failure.
Object Application
Syntax
object.BackupDB(szZipFileFullPath,
iItems, iMode)
Parameters szZipFileFullPath A string representing the name and path of the zip file to contain the backed up database. The default file extension of .ZIP is used if an extension is not specified.
iItems A short integer that specifies the items to be included in the backup. This value is created by ORing together values that represent the items to be included in the backup.
The following table lists the values for items to be included in the backup:
|
Value |
Item |
|
Value |
Item |
|
1 |
Reports |
|
4 |
Envelopes |
|
2 |
Labels |
|
8 |
Layouts |
iMode Specify 167 to overwrite existing backup files located as specified in the szZipFileFullPath parameter. Specify 168 to not overwrite existing backup files and return without creating a backup if existing backup files are found in the specified location.
Return type Long integer
See also RestoreDB
Description Gets and sets the text in the title bar for the view.
Object Application
Syntax object.Caption [= szTitleBar]
Parameters szTitleBar A string that specifies the text to appear in the title bar for the view. Omit this optional parameter to get the text that appears in the title bar.
Value type String/BSTR, Read/Write
GetLastError S_MAIN_WND
Example
'This example
gives the ACT! application a new caption.
Dim objApp as object
'Initialize the Application object.
'This starts ACT! if it is not already running.
Set objApp = CreateObject("ACTOLE.APPOBJECT")
'Change the ACT! title bar from "ACT!" to "My ACT! Application"
App.Caption = "My ACT! Application"
'Close the Application object.
Set objApp = Nothing
Description Changes the password for the specified user name. Returns S_ERROR on failure.
Object Application
Syntax object.ChangePassword(szUserName, szOldPassword, szNewPassword)
Parameters szUserName A string representing an existing user name.
szOldPassword A string representing the current password.
szNewPassword A string representing the new password.
Return type Long Integer
Comments To be able to change the password, the current user must have Administrator privilege or szUserName must be the current user. If szOldPassword and the currently registered password for szUserName do not match, the method fails.
GetLastError
S_NO_DB, S_NO_SECURITY, S_NO_USER, S_NOT_PRIVILEGED, S_NO_MATCH
See also AddUser
Example
'This example
changes the password for an existing user.
Dim objApp as object
'Initialize the Application object.
'This starts ACT! if it is not already running.
Set objApp = CreateObject("ACTOLE.APPOBJECT")
'Change the password of user Tim Kelly from "User" to "Password".
objApp.ChangePassword "Tim Kelly", "User", "Password"
'Close the Application object.
Set objApp = Nothing
ClearError Method (requires ACT! 4.0 or later)
Description Clears the last error.
Object Application
Syntax object.ClearError
Return type Void
See also GetLastError
Description Closes the database and all open views in the application. Returns S_ERROR on failure.
Object Application
Syntax object.CloseDB
Return type Long Integer
GetLastError S_ERROR
Description Executes the specified command. Returns S_ERROR on failure or if the specified command ID is not valid in the current context.
Object
Application
Syntax
object.Command(iCommandID)
Parameters iCommandID A short integer representing the command ID. For a list of values for this parameter, see the ACT! Command ID Reference appendix.
Return type Long Integer
GetLastError S_NOMENU, S_INVALID_CMD
| *VB * Execute the Write Other Documents... menu command objDatabase.Command(2304)
|
*VFox * Execute the Write Other Documents... menu command objDatabase.Command(2304)
|
Description Compresses the specified database. The database to be compressed should not be open. Use this method to maintain the database. Returns S_ERROR on failure.
Object Application
Syntax object.CompressDB(szDBName)
Parameters szDBName A string representing the name of the database that is to be compressed.
Return type Long Integer
GetLastError S_NO_DB, S_INVALID_INPUT
Comments It is possible that some database maintenance operations are occurring in the background after this method returns. Other database maintenance methods should not be invoked immediately after CompressDB.
See also PurgeHistories, PurgeNotes, PurgeTransactions, ReIndexDB
Example Note: Another database must be open before you can call these methods.
'This example reindexes and compresses the database "CONTACTS.DBF".
Dim objApp as object
'Initialize the Application object.
'This starts ACT! if it is not already running.
Set objApp = CreateObject("ACTOLE.APPOBJECT")
'Open ACT5DEMO.DBF.
objApp.OpenFile C:\My Documents\ACT\Database\ACT5demo.dbf
'Reindex and compress the database Contacts.dbf, which is not open.
objApp.ReIndexDB C:\My Documents\ACT\Database\CONTACTS.dbf
objApp.CompressDB C:\My Documents\ACT\Database\CONTACTS.dbf
'Close the Application object.
Set objApp = Nothing
GetActiveDB Method (not currently implemented)
Description Returns a dispatch pointer to the currently open database opened through OpenDB or OpenFile.
Object Application
Syntax object.GetActiveDB
Return type Object/LPDISPATCH
See also IsDBOpen, OpenDB, OpenFile
Description Gets the name of the application. Returns NULL on failure.
Object Application
Syntax
object.GetAppName
Return type String/BSTR
See also Caption, GetAppPath, GetOpenDBName
Example
'This example
lists the application name and path in a list box.
Dim objApp as object
'Initialize the Application object.
'This starts ACT! if it is not already running.
Set objApp = CreateObject("ACTOLE.APPOBJECT")
'List the application name in a list box. If the ACT! folder
'has an ACT.EXE this should list "ACT"
List1.AddItem objApp.GetAppName
'If ACT.EXE is in the C:\PROGRAM FILES\ACT folder,
'then "C:\PROGRAM FILES\ACT" should be listed.
List1.AddItem objApp.GetAppPath
'Close the Application object.
Set objApp = Nothing
Description Gets the path from where the ACT! application is currently executing. Returns NULL on failure.
Object
Application
Syntax
object.GetAppPath
Return type String/BSTR
GetLastError S_ERROR
See also GetAppName
Example See GetAppName.
GetCurrentUserName Method (requires ACT! 4.0 or later)
Description Returns a string containing the user name of the user currently logged on to the currently open database in the ACT! application.
Object Application
Syntax object.GetCurrentUserName
Return type String/BSTR
Description Returns a long integer representing the last error code for the object. For a list of error codes, see the following chapter.
Object Application
Syntax object.GetLastError
Return type Long Integer
Description Gets the file name of the active database. Returns NULL on failure.
Object Application
Syntax object.GetOpenDBName
Return type String/BSTR
GetLastError
S_CON_DOC
See also GetActiveDB
Example
'This example
gets the file name of the active database.
Dim objApp as object
'Initialize the Application object.
'This starts ACT! if it is not already running.
Set objApp = CreateObject("ACTOLE.APPOBJECT")
'If a database is already open.
If objApp.IsDBOpen = True then
'If the open database is not ACT5DEMO.DBF, then open it.
If objApp.GetOpenDBName <>
("C:\My Documents\ACT\Database\ACT5demo.dbf") then
objApp.OpenDB C:\My Documents\ACT\Database\ACT5demo.dbf
End If
End If
Set objDatabase = Nothing
'Close the Application object.
Set objApp = Nothing
Description Retrieves the position of the application’s frame window.
Object
Application
Syntax
object.GetPosition(lXPos,
lYPos)
Parameters lXPos A long integer (pointer in Visual C++) representing the X coordinate of the window’s top-left position.
lYPos A long integer (pointer in Visual C++) representing the Y coordinate of the window’s top-left position.
Return type Long Integer
See also GetSize, ReSize
Example
'This example
gets the location of the ACT! application.
Dim objApp as object
Dim lx as long
Dim ly as long
'Initialize the Application object.
'This starts ACT! if it is not already running.
Set objApp = CreateObject("ACTOLE.APPOBJECT")
'Get the location (Y and Y coordinates of the top left corner)
'of the ACT! application.
objApp.GetPosition lx, ly
List1.AddItem "ACT Position = " & lx & " , " & ly
'Close the Application object
Set objApp = Nothing