II
TC I II III IV V

 ACT! OLE Application Object

with and

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.

Conventions used in this section

This section provides syntax conventions and terminology used in this section.

Syntax conventions

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.

Terminology

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.

Parameter types

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
bParameter

Boolean

vParameter

Variant (VARIANT in Visual C++)

Special considerations

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.

Using properties in Visual C++

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.

Changing the focus

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.

System requirements

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

Development languages

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.

Using the Application Object with Visual C++

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.

Example C++ code

//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();

}

 

Understanding key files

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()
(to get the value of the property)

Preferences.SetExitPrompt()
(to get the value of the property)

 


ACT! OLE Application Object model

The following diagram shows the relationships of objects in the ACT! OLE Application Object model.


 


What’s new

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.

Changes for ACT! 4.0

Modified methods

The following methods have been modified for ACT! 4.0:

Object

Modified Methods

Change

Application

Command

Many values for lCommandID parameter added

Grid

GetColumnCount
GetColumnID
GetCurrentRow
GetRowCount
GetRowNumber

Return value on failure changed from 100 to -1

Preferences

GetEmailNewMsgInfo

Return string changed to:
CreateHist\InitialText

 

GetSchdActivityDefaults

PopupFields returned item added

 

GetSynchSchedule

Return string changed to:
SynchDays\SynchTime...

 

SetEmailNewMsgInfo

The szInfo parameter changed to:
CreateHist\InitialText

 

SetSchdActivityDefaults

PopupFields parameter added

 

SetSynchSchedule

The szInfo parameter changed to:
SynchDays\SynchTime...

Added properties and methods

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
BackupDB
ClearError
GetCurrentUsername
GetUserPrivilege
GetVersion
ProcessFile
RestoreDB

ContactListView

 

AddNewContactEx

ContactView

 

AddNewActivityEx
AddNoteHistoryEx
AttachFile
GetTabCount
GetTabName
LookupFieldEx
NewContactDialog
SelectContactDlg

Grid

 

GetFilter
RefreshGrid
SelectRow
SetFilter

GroupView

 

AddNoteEx
AttachFile
GetTabCount
GetTabName
LookupFieldEx
SaveQuery

Preferences

AttachMsgToContact
AttachToMsgUsing
CalMinDurationForBanner
ContactSalutation
GenerateSynchReport
GetSynchScheduleInfo
NewActivitiesSeparate
PromptToPrintEnvelope
ReceivedSynchLocation
RemindToBackup
ReturnReceipt
UseTypeahead
WaitTime

ClearError
EnableSpeedLoader
GetAttachmentInfo
GetDataToSynch
GetEmailSystem
GetLastError
GetSynchUpdateInfo
SetAttachmentInfo
SetDataToSynch
SetEmailSystem
SetSynchScheduleInfo
SetSynchUpdateInfo

TaskListView

 

AddNewActivityEx

Views

 

ClearError
GetLastError

Changes for ACT! 2000

Added properties and methods

The following new properties and methods have been added for ACT! 2000:

Object

New Properties

New Methods

Common properties and methods

ViewState

CurrentFieldId
CurrentRecord
GetMode
HasRecordChanged
LookupKeyword

Application

ActVersion

RemoveOutlookActivities
UpdateOutlookActivities

ContactView

¾

CompleteSale
CreateLookup
CreateSalesForecast
DeleteContactFast
Sales
TriggerActivitySeries

EmailView

¾

GetOpenFolderMessageCount
Sort

GroupView

¾

AddNewSubGroup
ChangeToParentGroup
ChangeToSubGroup
Collapse
DeleteGroupFast
Expand
GetSubGroupCount
GroupType
IsExpanded

MailComposeView

¾

AddBccRecepient
AddCcRecepient

Preferences

ShowContactParsingDialog

GetDBMaintReminderInfo
SetDBMaintReminderInfo

Views

¾

CreateEx

Changes for ACT! 2000 version 5.0.2

Modified methods

The following methods have been modified for ACT! 5.0.2:

Object

Modified Methods

Change

ContactView

GetActiveGroup
GrtCurrentID

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.

Added methods

The following new methods have been added for ACT! 2000 version 5.0.2:

Object

New Methods

Views

CreateBrowserView
CreateBrowserViewFromUrl
GetViewEx

Modified documentation

The syntax for the following methods has been corrected in this document for ACT! 2000 version 5.0.2:

Object

Modified Methods
(documentation only)

Change

ContactView

AddRecepient
AddCcRecepient
AddBccRecepient
ClearRecepients

Syntax corrected. Note: Use the exact specified spelling.



CHAPTER

Using Application Object Properties and Methods

This chapter contains descriptions of the different properties and methods that apply to the various ACT! OLE Application objects. The chapter is divided into sections devoted to the following ACT! 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.

Common properties and methods

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,
lTables,
iLookupType,
szGroupName

String,
Long Integer,
Short Integer,
String

Void

Maximize

None

¾

Boolean

Minimize

None

¾

Boolean

Parent

None

¾

Object/LPDISPATCH

ReSize

iHeight,
iWidth

Short Integer,
Short Integer

Long Integer

Show

True|False

Boolean

Long Integer

Update

None

¾

Long Integer

Activate Method

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

Active Property

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.

Application 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

Caption Property

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

Close Method

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

Displayed Property

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.

GetLastError 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

Email

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

Maximize Method

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

Minimize Method

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

 

Name Property

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

Parent Method

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

ReSize Method

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

Show Method

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

Type Property

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.

Update Method

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


Application object properties and methods

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,
szPassword,
iPrivilege

String,
String,
Short Integer

Long Integer

BackupDB

szZipFileFullPath,
iItems,
iMode

String,
Short Integer,
Short Integer

Long Integer

ChangePassword

szUserName, szOldPassword, szNewPassword

String,
String,
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,
lYPos

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

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,
lReserved

String,
Long Integer

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,
iWidth

Short Integer,
Short Integer

Long Integer

RestoreDB

szSourceZipFile,
szDestinationPath,
iMode

String,
String,
Short Integer

Long Integer

RunMacro

szMacroName

String

Long Integer

SaveCurrentLookup

szFilename

String

Long Integer

SendKey

lParam1,
lParam2,
lParam3

Long Integer, Long Integer, Long Integer

Long Integer

Show

True|False

Boolean

Long Integer

Update

None

¾

Long Integer

UpdateOutlookActivities

iUpdateDirection,
iDurationType

Short Integer,
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

AddUser Method

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

Caption Property

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

ChangePassword Method

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

CloseDB Method

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

Command Method

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)

 

CompressDB Method

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

GetAppName Method

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

GetAppPath Method

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

GetLastError Method

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

GetOpenDBName Method

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

GetPosition Method

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

GetSize Method

Description    Gets the size of the application frame window.

Object            Application

Syntax            object.GetSize(lWidth, lHeight)

Parameters    lWidth           A long integer (pointer to long integer in Visual C++) representing the width of the main window.

lHeight           A long integer (pointer to long integer in Visual C++) representing the height of the main window.

Return type   Long Integer

See also         GetPosition, ReSize

Example     'This example gets the size of the application frame window.

Dim objApp as object

Dim lHeight as long

Dim lWidth as long

 

'Initialize the Application object.

'This starts ACT! if it is not already running.

Set objApp = CreateObject("ACTOLE.APPOBJECT")

 

'Get the dimensions of the window.

objApp.GetSize lWidth, lHeight

List1.AddItem "Width = " & lWidth

List1.AddItem "Height = " & lHeight

 

'Close the Application object.

Set objApp = Nothing

GetUserId Method

Description    Gets the Unique ID of the user currently logged on to ACT!

Object            Application

Syntax            object.GetUserId

Return type   String/BSTR

GetLastError S_NO_OPENDB, S_NO_SECURITY, S_NO_USER

Example         'This example gets the Unique ID of the current user.

Dim objApp as object

Dim sUserId as string

 

'Initialize the Application object.

'This starts ACT! if it is not already running.

Set objApp = CreateObject("ACTOLE.APPOBJECT")

 

'Gets the Unique ID of the user currently logged on to ACT!

sUserId = objApp.GetUserId

 

'Close the Application object.

Set objApp = Nothing

GetUserPrivilege Method

Description    Gets the security level of the current user of the open database. Returns S_ERROR on failure.

Object            Application

Syntax     object.GetUserPrivilege

Return type   Long Integer

Comments     The following table lists the values that are returned by this method.

Value

Setting

 

Value

Setting

0

Browse

 

2

Administrator

1

Standard

 

 

 

GetLastError S_NO_SECURITY, S_NO_USER

GetVersion Method (requires ACT! 4.0 or later)

Description    Gets the version of the open ACT! database or the ACT! application. To get the version of an ACT! database it must be open. Returns NULL on error.

Object            Application

Syntax            object.GetVersion(iFor)

Parameters    iFor             A short integer representing the version to get. Specify 0 to get the version of the open ACT! database or 1 to get the version of the ACT! application.

Return type   String/BSTR

Help Method

Description    Displays the help window for the help topic specified by the context ID.

Object            Application

Syntax            object.Help [(szHelpFile, lContextID)]

Parameters    szHelpFile              A string representing the name of the help file.

lContextID             A long integer representing the context ID of the help topic to be displayed.

Return type   Long Integer

Comments     If both szHelpFile and lContextID are specified, the specified help topic is displayed; otherwise, the ACT! help system is started.

IsDBOpen Method

Description    Returns True if the database is open or False if it is not open.

Object            Application

Syntax            object.IsDBOpen

Return type   Boolean

See also         OpenDB

Example         See GetOpenDBName.

IsVisible Method

Description    Returns the display state of the application. Returns True if the main frame window of the application is visible or False if it is not visible.

Object            Application

Syntax            object.IsVisible

Return type   Boolean

GetLastError S_MAIN_WND

See also         GetSize, Maximize, Minimize, ReSize, Show

Example         See Show.

LastContactListModTime Property

Description    Returns the time at which the current lookup was last modified.

Object            Application

Syntax            object.LastContactListModTime

Value type      Long Integer, Read Only

Maximize Method

Description    Maximizes the application frame window. Returns S_ERROR on failure.

Object            Application

Syntax            object.Maximize

Return type   Long Integer

GetLastError S_MAIN_WND

See also         GetSize, Minimize, ReSize, Show

Minimize Method

Description    Minimizes the application frame window. Returns S_ERROR on failure.

Object            Application

Syntax            object.Minimize

Return type   Long Integer

GetLastError S_MAIN_WND

See also         GetSize, Maximize, ReSize, Show

OpenDB Method

Description    Closes the active database, opens the specified database.

Object            Application

Syntax            object.OpenDB(szDBName)

Parameters    szDBName             A string representing the name of the database to be opened.

Return type   Object/LPDISPATCH

GetLastError S_INVALID_INPUT

Comments     Normally, invoking OpenDB displays the Login dialog box. Invoking this method (or the OpenFile method) before the user responds to the Login dialog box causes unpredictable results.

See also         GetActiveDB, IsDBOpen, OpenFile

Example         'This example opens the ACT5DEMO database.

Dim objApp as object

 

'Initialize the Application object.

'This starts ACT! if it is not already running.

Set objApp = CreateObject("ACTOLE.APPOBJECT")

objApp.OpenDB C:\My Documents\ACT\Database\ACT5demo.dbf

 

'Close the Application object.

Set objApp = Nothing

OpenFile Method

Description    Opens the specified database file. Opening a database file closes the currently active database and makes the new database the active database.

Object            Application

Syntax            object.OpenFile(szDBName)

Parameters    szDBName             A string representing the name of the database file to be opened.

Return type   Long Integer

GetLastError S_INVALID_INPUT

Comments     Normally, invoking OpenFile displays the Login dialog box. Invoking this method (or the OpenDB method) before the user responds to the Login dialog box causes unpredictable results.

See also         GetActiveDB, IsDBOpen, OpenDB

Example         'This example opens the ACT5DEMO.DBF database file.

 

Dim objApp as object

 

'Initialize the Application object.

'This starts ACT! if it is not already running.

Set objApp = CreateObject("ACTOLE.APPOBJECT")

objApp.OpenFile C:\My Documents\ACT\Database\ACT5demo.dbf

objApp.Maximize

 

'Close the Application object.

Set objApp = Nothing

Preferences Method

Description    Returns a dispatch pointer to the Preferences object. The returned dispatch pointer can be used to manipulate user preferences within the ACT! application. This method fails if there is no open database. Returns NULL on error.

Object            Application

Syntax            object.Preferences

Return type   Object/LPDISPATCH

GetLastError S_NO_OPENDB, S_MEM_ERROR

ProcessFile Method

Description    Launches the specified file from the NetLinks folder. Returns S_ERROR on failure.

Object            Application

Syntax            object.ProcessFile(szFilename, lReserved)

Parameters    szFilename             A string representing the file name of a file in the NetLinks folder.

lReserved               A long integer value reserved for future use.

Return type   Long Integer

GetLastError S_ERROR

PurgeHistories Method

Description    Purges histories of all contacts and against all activities for the specified database. The database should not be the currently open database. Use this method to maintain the database. Returns S_ERROR on failure.

Object            Application

Syntax            object.PurgeHistories(szDBName)

Parameters    szDBName             A string representing the name of the database where histories are to be purged.

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 PurgeHistories.

See also         PurgeNotes, PurgeTransactions

Example         'This example purges all history records for the CONTACTS database.

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

 

'Purge all history records for the CONTACTS database.

objApp.PurgeHistories "C:\My Documents\ACT\Database\CONTACTS.dbf"

 

'Close the Application object.

Set objApp = Nothing

PurgeNotes Method

Description    Purges notes for all contacts and against all activities for the specified database. The database should not be the currently open database. Use this method to maintain the database. Returns S_ERROR on failure.

Object            Application

Syntax            object.PurgeNotes(szDBName)

Parameters    szDBName             A string representing the name of the database where notes are to be purged.

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 PurgeNotes.

See also         PurgeHistories, PurgeTransactions

Example         'This example purges all notes in the CONTACTS database.

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

 

'Purge all notes for the CONTACTS database.

objApp.PurgeNotes C:\My Documents\ACT\Database\CONTACTS.dbf

 

'Close the Application object.

Set objApp = Nothing

PurgeTransactions Method

Description    Purges all transactions for all contacts and against all activities for the specified database. The database should not be the currently open database. Use this method to maintain the database. Returns S_ERROR on failure.

Object            Application

Syntax            object.PurgeTransactions(szDBName)

Parameters    szDBName             A string representing the name of the database where histories are to be purged.

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 PurgeTransactions.

See also         PurgeHistories, PurgeNotes

Example         'This example purges all transactions for the CONTACTS database.

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

 

'Purge all transactions for the CONTACTS database.

objApp.PurgeTransactions C:\My Documents\ACT\Database\ACT5demo.dbf

 

'Close the Application object.

Set objApp = Nothing

ReIndexDB Method

Description    Reconstructs the index for the specified database. The database should not be the currently open database. Use this method to maintain the database. Returns S_ERROR on failure.

Object            Application

Syntax            object.ReIndexDB(szDBName)

Parameters    szDBName             A string representing the name of the database to be reindexed. The database should not be the current database

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 ReIndexDB.

See also         CompressDB

Example         See CompressDB.

RemoveOutlookActivities Method (requires ACT! 2000 or later)

Description    Removes Outlook activities from ACT!, or ACT! Activities from Outlook, or both depending on the parameters used. This method applies only when Outlook is installed. Returns 0 if successful or returns an error code if unsuccessful. For a list of error codes, see the following chapter.

Object            Application

Syntax            object.RemoveOutlookActivities (iRemoveIn)

Parameters    iRemoveIn              A short integer representing the activities to remove.

                              The following table lists the value for each activity type:

Value

Activities

1

Removes Outlook activities from ACT!

2

Removes ACT! activities from Outlook

3

Removes Outlook activities from ACT! and removes ACT! activities from Outlook

Return type   Long Integer

See also         UpdateOutlookActivities

ReSize Method

Description    Sets the size of the application main frame window. The current (top-left) position of the frame is unchanged. Returns S_ERROR on failure.

Object            Application

Syntax            object.ReSize(iHeight, iWidth)

Parameters    iHeight                   A short integer representing the new height of the frame.

iWidth                    A short integer representing the new width of the frame.

Return type   Long Integer

GetLastError S_MAIN_WND

See also         GetPosition, GetSize, Maximize, Minimize, Show

Example         'This example resizes 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")

 

'Resize the application window.

objApp.ReSize 500, 800

 

'Close the Application object.

Set objApp = Nothing

RestoreDB Method (requires ACT! 4.0 or later)

Description    Restores the database from the specified zip file name and location. Returns S_ERROR on failure.

Object            Application

Syntax            object.BackupDB(szSourceZipFile, szDestinationPath, iMode)

Parameters     szSourceZipFile     A string representing the source name and path of the zip file containing the backed up database to be restored.

szDestinationPath  A string representing the destination name and path for the database to be restored.

iMode                    Specify 167 to overwrite any existing database located as specified in the szDestinationPath parameter. Specify 168 to not overwrite an existing database and return without restoring the backup if an existing database is found in the specified location.

Return type   Long Integer

See also         BackupDB

RunMacro Method

Description    Runs the macro stored in the specified file at recorded speed. Returns S_ERROR on failure.

Object            Application

Syntax            object.RunMacro(szMacroName)

Parameters    szMacroName        A string representing the full path and file name of the file containing the macro.

Return type   Long Integer

GetLastError S_INVALID_INPUT, S_MACRO_ERROR

Example         'This example runs the MYMACRO macro.

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

 

'Run the macro MYMACRO. (Macro files have extension .MPR and

'are stored in C:\PROGRAM FILES\ACT\macro by default.)

objApp.RunMacro "C:\PROGRAM FILES\ACT\macro\mymacro.mpr"

 

'Close the Application object.

Set objApp = Nothing

SaveCurrentLookup Method

Description    Saves the current lookup in the specified file. If a file with the same name exists, it is overwritten. Returns S_ERROR on failure.

Object            Application

Syntax            object.SaveCurrentLookup(szFilename)

Parameters    szFilename             A string representing the name of the file where the lookup should be saved.

Return type   Long Integer

GetLastError S_CON_DOC, S_CON_LIST, S_ERROR, S_FILE_OPEN

SendKey Method

Description    Sends a message to the application. Similar to Windows SendMessage. Currently only WM_CHAR messages are sent.

Object            Application

Syntax            object.SendKey(lParam1, lParam2, lParam3)

Parameters    lParam1                 A long integer specifying additional data to be sent.

lParam2                 A long integer specifying additional data to be sent. (Currently ignored.)

lParam3                 A long integer specifying additional data to be sent. (Currently ignored.)

Return type   Long Integer

Comments     The returned value depends on the message being sent.

 

Show Method

Description    Hides or displays the application frame window. Returns S_ERROR on failure.

Object            Application

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_ERROR, S_MAIL_WND

Comments     After the application frame window is hidden, any action that causes a dialog box to be displayed might cause the frame window to become visible again.

See also         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

Update Method

Description    Redraws the application frame window. Returns S_ERROR on failure.

Object            Application

Syntax            object.Update

Return type   Long Integer

UpdateOutlookActivities Method (requires ACT! 2000 or later)

Description    Updates ACT! with Outlook activities, or Outlook with ACT! activities, or both depending on the parameters used. This method applies only when Outlook is installed. Returns 0 if successful or returns an error code if unsuccessful. For a list of error codes, see the following chapter.

Object            Application

Syntax            object.UpdateOutlookActivities (iUpdateDirection, iDurationType)

Parameters    iUpdateDirection   A short integer representing the direction of the update.

                              The following table lists the values for this parameter:

Value

Direction

1

From ACT! to Outlook

2

From Outlook to ACT!

3

Both

 

iDurationType       A short integer representing the duration type of the update.

                              The following table lists the values for this parameter:

Value

Duration

1

All days

2

Today

3

Today and in the future

4

Over the next 30 days

Return type   Long Integer

See also         RemoveOutlookActivities

Example         'The following line updates ACT! with activities in Outlook for today.

 

ret = objApp.UpdateOutlookActivities(1, 2)

Views Method

Description    Returns a dispatch pointer to the view collection object. The returned dispatch pointer can be used to create new views and access and manipulate any existing views in the application. This method fails if there is no open database. Returns NULL on error.

Object            Application

Syntax            object.Views

Return type   Object/LPDISPATCH

GetLastError S_NO_OPENDB, S_MEM_ERROR

Example         'This example creates a Views object.

 

Dim objApp as object

Dim objViews 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

 

'Create a Views object.

Set objViews = App.Views

 

'Close the Application object.

Set objApp = Nothing


CalendarView object methods

The CalendarView object provides an interface to use the Calendar view in the ACT! application. The following properties and methods apply only to the CalendarView object. See “Common properties and methods” for properties and additional methods that apply to the CalendarView object.

Methods

Method name

Parameter(s)

Parameter type(s)

Return type

GetActiveMonth

None

¾

Short Integer

GetCalendarMode

None

¾

Short Integer

SetActiveMonth

iMonth

Short Integer

Long Integer

SetCalendarMode

iMode

Short Integer

Long Integer

The following sample code demonstrates how to use the CalendarView object:

Dim objApp as object

Dim objViews as object

Dim objCal as object

Dim i as long

 

'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

 

'Create a Views object.

Set objViews = App.Views

 

'Create the Calendar object.

Set objCal = objViews.Create(5, "MyCal")

 

'If the Calendar Active month is not April, then set it to April.

If objCal.GetActiveMonth <> 4 Then

   objCal.SetActiveMonth (4)

End If

 

'If the Calendar is not weekly, then set it to weekly.

If objCal.GetCalendarMode <> 301 Then

   objCal.SetCalendarMode (301)

End If

 

objViews.CloseAll

Set objCal = Nothing

Set objViews = Nothing

 

'Close the Application object.

Set objApp = Nothing

GetActiveMonth Method

Description    Returns the month between 1 and 12 indicating the active in the calendar view. Returns 0 (zero) on error.

Object            CalendarView

Syntax            object.GetActiveMonth

Return type   Short Integer

GetLastError S_NO_CALVW

See also         SetActiveMonth

GetCalendarMode Method

Description    Returns the mode in which the calendar is being displayed.

Object            CalendarView

Syntax            object.GetCalendarMode

Return type   Short Integer

Comments     The following table lists the values that are returned by this method.

Value

Mode

 

Value

Mode

300

Monthly calendar

 

302

Daily calendar

301

Weekly calendar

 

0

Error

GetLastError S_NO_CALVW

See also         SetCalendarMode

SetActiveMonth Method

Description    Sets the specified month to be the active month in the calendar view. Returns S_ERROR on an invalid month.

Object            CalendarView

Syntax            object.SetActiveMonth(iMonth)

Parameters    iMonth                   A short integer between 1 and 12 representing the active month.

Return type   Long Integer

GetLastError S_NO_CALVW, S_INVALID_INPUT

See also         GetActiveMonth

SetCalendarMode Method

Description    Sets the mode in which the calendar is displayed in the calendar view and activates the view.

Object            CalendarView

Syntax            object.SetCalendarMode(iMode)

Parameters    iMode                    A short integer representing the mode for displaying the calendar:

Value

Mode

 

Value

Mode

300

Monthly

 

302

Daily

301

Weekly

 

 

 

                                                      If iMode is not one of the above values, the mode is set to Monthly.

Return type   Long Integer

GetLastError S_NO_CALVW

See also         GetCalendarMode


ContactListView object methods

The ContactListView object provides an interface to use the Contact List view in the ACT! application. The following methods apply only to the ContactListView object. See “Common properties and methods” for properties and additional methods that apply to the ContactListView object.

Method

Method name

Parameter(s)

Parameter type(s)

Return type

AddNewContactEx

None

¾

String/BSTR

GetGrid

None

¾

Object/LPDISPATCH

AddNewContact Method (obsolete)

Use AddNewContactEx instead of this method.

AddNewContactEx Method (requires ACT! 4.0 or later)

Description    Adds a new contact to the database. Use SetField in the Grid object to set the fields in the newly created row. Returns the Unique ID of the new contact. Use GetRowNumber in the Grid object to find the row number of the new contact.

Object            ContactListView

Syntax            object.AddNewContactEx

Return type   String/BSTR

Comments     The new contact appears as the first visible row in the Contact List view. The Contact List view is activated after a call to this method.

See also         AddNewContact
GetField, GetRowNumber, SetField, in Grid object

Example         'This example adds a new contact in the Contact List view.

 

Dim objCtListView As Object

Dim objCtView As Object

Dim objCtListGrid As Object

Dim RN As Integer

Dim objV As Object

Dim uid As String

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.OpenDB C:\My Documents\ACT\Database\ACT5demo.dbf

 

'Create the Views object.

Set objViews = objApp.Views

'Create the Contact List view.

Set objCtListView = objViews.Create(2, "CL")

'Create the Grid object.

Set objCtListGrid = objCtListView.GetGrid

 

'Add a new Contact record and get the Unique ID.

uid = objCtListView.AddNewContactEx

'Get the row number.

RN = objCtListGrid.GetRowNumber(uid)

 

'Populate the fields.

objCtListGrid.SetField CF_Name, RN, "Carl Bowman"

RN = objCtListGrid.GetRowNumber(uid)

objCtListGrid.SetField CF_Company, RN, "Cordoba Coffee Shops"

RN = objCtListGrid.GetRowNumber(uid)

objCtListGrid.SetField CF_Phone, RN, "415-555-1212"

RN = objCtListGrid.GetRowNumber(uid)

objCtListGrid.SetField CF_Title, RN, "Engineer"

Set objCtListGrid = Nothing

 

'Close the Contact List view.

objCtListView.Close

Set objCtListView = Nothing

Set objViews = Nothing

'Close the Application object.

Set objApp = Nothing

GetGrid Method

Description    Returns a dispatch pointer to a grid object for the Contact List view. The returned dispatch pointer can be used to manipulate the grid object. Returns NULL on error.

Object            ContactListView

Syntax            object.GetGrid

Return type   Object/LPDISPATCH

GetLastError S_ERROR

Example         'This example returns a dispatch pointer.

 

Dim objApp as object

Dim objViews as object

Dim objContactListView as object

Dim objContactListViewGrid 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

 

'Initialize the Views object.

Set objViews = objApp.Views

 

List1.AddItem objApp.GetLastError

Set objCtListView = objViews.Create(2, "CL")

 

'Get the Grid Object in the Contact List.

Set objCtListGrid = objCtListView.GetGrid

 

'List the contact name and company for all the contacts in the Contact List.

For i = 0 To objCtListGrid.GetRowCount - 1

   List1.AddItem objCtListGrid.GetField(CF_Name, i) & "  ,  " &

       objCtListGrid.GetField(CF_Company, i)

Next i

 

Set objCtListGrid = Nothing

objCtListView.Close

Set objCtListView = Nothing

Set objViews = Nothing

Set objApp = Nothing


ContactView object methods

The ContactView object provides an interface to use the Contact view in the ACT! application. The following methods apply only to the ContactView object. See “Common properties and methods” for properties and additional methods that apply to the ContactView object.

Methods

Method name

Parameter(s)

Parameter type(s)

Return type

Activities

None

¾

Object/LPDISPATCH

AddContactToGroup

szGroupID

String

Long Integer

AddNewActivityEx

szContactID…,
szDate
Time,
iType,
iTimeless,
szRegarding,
lDuration

String,
String,
Short Integer,
Short Integer,
String,
Long Integer

String/BSTR

AddNewContact

None

¾

Long Integer

AddNoteHistoryEx

iType

Short Integer

String/BSTR

AttachFile

szFilename

String

Long Integer

BOL

None

¾

Boolean

CompleteSale

szSaleID,
iStatus,
dateClosed,
szReason,
lUnits,
fUnitPrice,
fAmount

String
Short Integer
Date
String
Long Integer
Float (Single)
Float (Single)

Long Integer

CreateLookup

szContact…

String

Long Integer

CreateSalesForecast

szContactID,
szProductID,
szType,
szCompetitor,
lUnits,
fUnitPrice,
fAmount,
dateClose,
lProb

String,
String,
String,
String ,
Long Integer,
Float (Single),
Float (Single),
Date,
Long Integer

String

Delete

None

¾

Long Integer

DeleteContactFast

None

¾

Long Integer

EOL

None

¾

Boolean

GetActiveGroup

None

¾

String/BSTR

GetActiveGroupName

None

¾

String/BSTR

GetActiveTab

None

¾

String/BSTR

GetCount

None

¾

Short Integer

GetCurrentID

None

¾

String/BSTR

GetField

lFieldID

Long Integer

String/BSTR

GetTabCount

None

¾

Short Integer

GetTabName

iTabNo

Short Integer

String/BSTR

Goto

szContactID

String

Long Integer

GroupMembership

None

¾

Object/LPDISPATCH

LookupAll

None

¾

Long Integer

LookupFieldEx

lFieldID,
szFieldValue,
iType

Long Integer,
String,
Short Integer

Long Integer

LookupMyRecord

None

¾

Long Integer

LookupPrevious

None

¾

Long Integer

MoveFirst

None

¾

Long Integer

MoveLast

None

¾

Long Integer

MoveNext

None

¾

Long Integer

Moveprevious

None

¾

Long Integer

NewContactDialog

None

¾

Long Integer

NotesHistory

None

¾

Object/LPDISPATCH

RunQuery

szQueryFile

String

Long Integer

Sales

None

¾

Object/LPDISPATCH

SaveQuery

szQueryFile

String

Long Integer

SelectContactDlg

szText

String

String/BSTR

SetActiveGroup

szGroupID

String

Long Integer

SetActiveGroupName

szGroupName

String

Long Integer

SetActiveTab

szTabName

String

Long Integer

SetField

lFieldID,
szFieldValue

Long Integer,
String

Long Integer

TriggerActivitySeries

iLookupType,
SeriesDate,
szActivitySeriesName

Short Integer,
Date,
String

Long Integer

Activities Method

Description    Returns a dispatch pointer to a Grid object for the Activities tab. The Activities tab must be the active tab before calling this method. Returns NULL on error.

Object            ContactView

Syntax            object.Activities

Return type   Object/LPDISPATCH

GetLastError S_MEM_ERROR, S_NO_DALLIST_VIEW, S_UNKNOWN

See also         GetActiveTab, NotesHistory, SetActiveTab

AddContactToGroup Method

Description    Adds the current contact to the specified group. If the function is successful, the specified group appears in the Groups tab of the Contact view. If the contact is currently a member of the specified group or the Unique ID is invalid, this method fails. Returns S_ERROR on failure.

Object            ContactView

Syntax            object.AddContactToGroup(szGroupID)

Parameters    szGroupID             A string representing the Unique ID of the group.

Return type   Long Integer

GetLastError S_ADD_CONTACT, S_DUPLICATE_GRP, S_INVALID_INPUT, S_UNKNOWN

See also         AddMembersToGroup in GroupView object

Example         'This example adds the current contact to the group with the ID GroupID.

Dim objApp as object

Dim objViews as object

Dim objContact 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

 

'Create a Views object.

Set objViews = objApp.Views

'Create the ContactView object.

Set objContact = objViews.Create(1, "MyContact")

 

'Set Groups to be the active tab.

objContact.SetActiveTab "Groups"

 

'Add the current contact in the Contact view to the group

'with the Unique ID GroupID.

objCView.AddContactToGroup GroupId

 

'Close the Contact view.

objContact.Close

Set objContact = Nothing

Set objViews = Nothing

'Close the Application object.

Set objApp = Nothing

AddNewActivity Method (obsolete)

Use AddNewActivityEx instead of this method.

AddNewActivityEx Method (requires ACT! 4.0 or later)

Description    Adds a new activity for the specified contacts using Activity defaults set in Preferences. Returns the Unique ID of the new activity on success and NULL on failure. If any ID in szContactID is invalid, this method returns S_OK, but GetLastError returns S_INVALID_INPUT. Use GetFilter and SetFilter in the Grid object before using this method.

Object            ContactView

Syntax            object.AddNewActivityEx(szContactID…, szDateTime, iType, iTimeless, szRegarding, lDuration)

Parameters    szContactID           A string representing the Unique ID(s) of contacts with which the new activity will be associated. If a NULL value is specified for this required parameter, the new activity will be associated with the default of the current database user.

Note: Specify multiple Unique IDs as a continuous string of 12‑character values, with no delimiters between the Unique ID values.

szDateTime            A string representing the starting date and time of the activity, formatted in Windows Regional Settings Short Date style and Time style.

iType                      A short integer representing the type of activity to be added.

The following table lists the values for this parameter.

Value

Setting

 

Value

Setting

0

Call

 

2

To-do

1

Meeting

 

 

 

                        iTimeless                A short integer representing the timeless status of the activity to be added.

The following table lists the values for this parameter.

Value

Setting

0

Not timeless

1

Timeless

                        szRegarding           A string representing the description of the activity.

lDuration               A long integer representing the duration in minutes of the activity.

Return type   String/BSTR

GetLastError S_ACTIVITY_INIT_FAIL, S_CON_DOC, S_HELPER_EEDIT_FAIL, S_INVALID_INPUT, S_PROPS_NOT_FOUND, S_UNKNOWN

Example         'This example adds a high priority to-do to the current contact, dated '10/20/98, at 10:00 AM, duration 45 minutes, regarding "A Meeting".

 

'Initialize the application object.

Set objApp = CreateObject("ACTOLE.APPOBJECT")

 

'Create the Views object.

Set objViews = objApp.Views

 

'Create the Contacts view.

Set objCView = objViews.Create(1, "CV")

 

'Get the Unique ID of the current contact.

sContact = objCView.GetCurrentID

'Set Activities to be the Active Tab

objCView.SetActiveTab "Activities"

 

'Create the Grid object.

Set objActiv = objCView.Activities

'Get Activities filter values.

objActiv.GetFilter x, y, z

j = 1 or 2 or 4 or 8 or 16 or 32 or 64 or 128

objActiv.SetFilter j, 1, " "

 

'Add an activity. Its Unique ID is returned in uid as a string.

uid = objCView.AddNewActivityEx(sContact, "10/20/98 10:00AM",

   activitytype_meeting,0,"A meeting", "45")

'Get the row number.

RN = objActiv.GetRowNumber(uid)

 

'Set other parameters in the activity.

objActiv.SetField AF_Priority, RN, activitypriority_medium

 

'Reset the Activities filter values.

objActiv.SetFilter x, y, z

 

Set objActiv = Nothing

Set objCView = Nothing

AddNewContact Method

Description    Displays a new contact with all fields blank. Use SetField to populate the contact fields.

Object            ContactView

Syntax            object.AddNewContact

Return type   Long Integer

GetLastError S_UNKNOWN

See also         Delete, GetField, SetField

Example         'This example displays the Contact view and adds a contact.

 

Dim objApp as object

Dim objViews as object

Dim objContact 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

 

'Create a Views object.

Set objViews = App.Views

 

'Create the ContactView object –This brings up the Contact view.

Set objContact = objViews.Create(1, "MyContact")

 

'Add a contact with all blank fields. Set the Contact, Company,

'address and Phone fields.

objContact.AddNewContact

objCView.SetField CF_Name, "My Contact"

objCView.SetField CF_Company, "My Company"

objCView.SetField CF_Address1, "My Address1"

objCView.SetField CF_City, "City"

objCView.SetField CF_State, "State"

objCView.SetField CF_Phone, "415-555-1212"

objCView.SetField CVF_EmailAddress, "MyContact@MyCompany.com"

 

'Close the Contact view.

objContact.Close

objViews.CloseAll

Set objContact = Nothing

Set objViews = Nothing

'Close the Application object.

Set objApp = Nothing

AddNoteHistory Method (obsolete)

Use AddNoteHistoryEx instead of this method.

AddNoteHistoryEx Method (requires ACT! 4.0 or later)

Description    Adds a Notes/History record for the current contact. Use SetField in the Grid object to set other fields in the newly created row. The Notes/History tab must be the active tab before calling this method. Returns the Unique ID of the new Notes/History record on success and NULL on failure. Use GetFilter and SetFilter in the Grid object before using this method.

Note: This method extends the functionality of the AddNoteHistory method.

Object            ContactView

Syntax            object.AddNoteHistoryEx(iType)

Parameters    iType                      A short integer indicating whether a note or the type of history to be added. To add a note, iType must be 100.

                                                      To add a history, iType must be one of the following values:

Value

Setting

 

Value

Setting

0

Call attempted

 

7

Meeting not held

1

Call completed

 

8

To-do done

2

Call received

 

9

To-do not done

6

Meeting held

 

17

Left message

Return type   String/BSTR

GetLastError S_CON_DOC, S_INVALID_INPUT, S_MEM_ERROR, S_NO_DALLIST_VIEW, S_NO_RECORD, S_RECORD_HISTORY, S_UNKNOWN

See also         AddNoteHistory
GetField, SetField in Grid object
AddNote in GroupView object

Example         'This example adds a note to the current contact.

'Initialize the application object.

 

Set objApp = CreateObject("ACTOLE.APPOBJECT")

 

'Create the Views object.

Set objViews = objApp.Views

 

'Create the Contact view.

Set objCView = objViews.Create(1, "CV")

 

'Get the Unique ID of the Current contact.

sContact = objCView.GetCurrentID

 

'Set Notes/History to be the active tab.

objCView.SetActiveTab "Notes/History"

 

Create the Grid object.

Set objNH = objCView.NotesHistory

 

'Add a note. The Unique ID is returned in uid as a string.

uid = objCView.AddNoteHistoryEx(100)

 

'Get the row number.

RN = objNH.GetRowNumber(uid)

objNH.SetField NHF_Text, RN, " Test Note"

objNH.SetField NHF_UserTime, RN, "10/28/98 8:00AM"

 

Set objNH = Nothing

Set objCView = Nothing

AttachFile Method (requires ACT! 4.0 or later)

Description    Adds the specified file as an attachment to the Notes/History tab of the Contacts view. Returns S_OK on success and S_ERROR on failure UID of record created.

Object            ContactView

Syntax            object.AttachFile(szFilename)

Parameters    szFilename             A string representing the complete path and the file name of the file to add as an attachment.

Return type   Long Integer

GetLastError S_CON_DOC, S_ERROR, S_NOT_FOUND, S_UNKNOWN

See also         AttachFile in GroupView object

 

BOL Method

Description    Returns True if the current contact is at the beginning of the lookup or False if it is not at the beginning of the lookup or if an error occurs.

Object            ContactView

Syntax            object.BOL

Return type   Boolean

GetLastError S_CON_DOC, S_UNKNOWN

See also         EOL, Goto, MoveFirst, MoveLast, MoveNext, Moveprevious

CompleteSale Method (requires ACT! 2000 or later)

Description    Completes the specified sale. Returns 0 if successful or an error code if unsuccessful. For a list of error codes, see the following chapter.

Object            ContactView

Syntax            object.CompleteSale (szSaleID, iStatus, dateClosed, szReason, lUnits, fUnitPrice, fAmount)

Parameters    szSaleID                A string representing the Unique ID of the sales opportunity record for which to complete the sale.

iStatus                    A short integer representing the status of the sale.

                              The following table lists the values for this parameter:

Value

Status

 

Value

Status

0

Open

 

2

Lost

1

Won

 

 

 

 

dateClosed             The date the sale closed, formatted in Windows Regional Settings Short Date style.

szReason                A string representing the reason the sale was won or lost.

lUnits                     A long integer representing the number of units sold.

fUnitPrice              A float (single) representing the price at which each unit was sold.

fAmount                 A float (single) representing the total amount of the sale.

Return type   Long Integer

See also         CreateSalesForecast, Sales

Example         'The following example code closes a particular sale.

 

Set objViews = objApp.Views

Set objContactView = objViews.Create(1, "CL")

objContactView.Goto ContactId

objContactView.SetActiveTab "Sales/Opportunities"

Set objSales = objContactView.Sales

   'Get the Sale Unique ID for a particular row number.

   SaleId = objSales.GetUniqueID(RowNumber)

 

'If the sales is not closed, then complete it.

If objSales.GetField(SLF_Status, i) = "Sales Opportunity" Then

'Won the Sale, new close date 8/6/99, new unit price 10.85,

'quantity 6000.

   objContactView.CompleteSale SaleId, 1, "8/06/99",

       "We lowered the price to beat the competition", 6000, 10.85,

       (10.85 * 6000)

End If

CreateLookup Method (requires ACT! 2000 or later)

Description    Creates a lookup of the list of Contact Unique IDs concatenated without delimiters. Returns 0 if successful or returns an error code if unsuccessful. For a list of error codes, see the following chapter.

Object            ContactView

Syntax            object.CreateLookup (szContactID…)

Parameters    szContactID           A string representing the Unique IDs of the contacts.

Note: Specify multiple Unique IDs as a continuous string of
12-character values, with no delimiters between the Unique ID values.

Return type   Long Integer

Example         'The following sample creates a lookup of 3 contacts whose Unique IDs

'you have.

 

Set objViews = objApp.Views

Set objContactView = objViews.Create(1, 2)

 

'Moving first.

objContactView.MoveFirst

'Concatenate the Unique IDs of the contacts to include in the lookup.

ContactId = ContactId1 & ContactId2 & ContactId3

'Create the lookup of the 3 contacts.

objContactView.CreateLookup ContactId

CreateSalesForecast Method (requires ACT! 2000 or later)

Description    Creates a new sales opportunity and returns its Unique ID.

Object            ContactView

Syntax            object.CreateSalesForecast (szContactID, szProductID, szType, szCompetitor, lUnits, fUnitPrice, fAmount, dateClose, lProb)

Parameters    szContactID           A string representing the Unique ID of the contact to which to associate the sales opportunity.

szProductID           A string representing the Unique ID of the product.

szType                    A string representing the Unique ID of the product type to which to associate the sales record.

szCompetitor          A string representing the name of the main competitor for the sale.

lUnits                     A long integer representing the number of units expected to be sold.

fUnitPrice              A float (single) representing the price at which each unit is expected to be sold.

fAmount                 A float (single) representing the expected total amount of the sale.

dateClose               The date the sale is expected to close.

lProb                     A long integer representing the probability of winning the sale in a percentage value between 0 and 100.

Return type   String

See also         CompleteSale, Sales

Example         'The following code creates a new Sales Opportunity for 6000 pcs of

'ProductA of "TypeA"@$11 each and with main competitor BigCorp, Inc.

 

Set objViews = objApp.Views

Set objContactView = objViews.Create(1, "CL")

objContactView.Goto ContactId

objContactView.SetActiveTab "Sales/Opportunities"

Set objSales = objContactView.Sales

'New Sales Opportunity for ProductA of TypeA , 6000 units at $11 each,

'close date 10/22/99 and 65% probability.

sid = objContactView.CreateSalesForecast(ContactId, "ProductA",

   "TypeA", "BigCorp, Inc.", 6000, 11#, (11# * 1000), "10/22/99", 65)

'Get the row number.

RN = objSales.GetRowNumber(sid)

'Set the "SalesStage"

objSales.SetField SLF_SalesStage, RN, "New Opportunity"

RN = objSales.GetRowNumber(sid)

'Set the start date for the sale.

objSales.SetField SLF_SaleStartDate, RN, "4/4/99"

Delete Method

Description    Deletes the selected contact and all details about the contact including activities, notes and histories. Displays a dialog box to confirm the deletion.

Object            ContactView

Syntax            object.Delete

Return type   Long Integer

GetLastError S_UNKNOWN

See also         AddNewContact

DeleteContactFast Method (requires ACT! 2000 or later)

Description    Deletes the current contact without invoking the confirmation dialog boxes. Returns 0 if the contact is successfully deleted or an error code if unsuccessful. For a list of error codes, see the following chapter.

Object            ContactView

Syntax            object.DeleteContactFast

Return type   Long Integer

See also         DeleteGroupFast in GroupView object

Example         'The following sample selects a contact and then deletes it.

 

Set objContactView = objViews.Create(1, "CL")

objContactView.MoveFirst

'Select the contact you want to delete.

ContactId = objContactView.SelectContactDlg("Select Contact you would like

   to delete")

objContactView.Goto ContactId

objContactView.GetField (CF_Name)

'Create a confirmation message, since ACT! will now not provide one.

ret = MsgBox("Are you sure you want to delete " & ContactName & " ?", vbYesNo Or vbExclamation)

'If the user selected Yes, delete the contact.

If ret = vbYes Then

   objContactView.DeleteContactFast

End If

EOL Method

Description    Returns True if the current contact is at the end of the lookup or False if it is not at the end of the lookup or if an error occurs.

Object            ContactView

Syntax            object.EOL

Return type   Boolean

GetLastError S_CON_DOC, S_UNKNOWN

See also         BOL, Goto, MoveFirst, MoveLast, MoveNext, Moveprevious

GetActiveGroup Method

Description    Gets the Unique ID of the active group. If the active group is <No Group>, an empty string or blank is returned.

Note: If you are using a version of ACT! prior to ACT! 2000 version 5.0.2, this method activates the Contact View upon return. For ACT! 2000 version 5.0.2 or later, this method does not activate the Contact View. Use the Activate method to activate the Contact View if necessary.

Object            ContactView

Syntax            object.GetActiveGroup

Return type   String/BSTR

GetLastError S_CON_DOC, S_UNKNOWN

See also         GetActiveGroupName, SetActiveGroup, SetActiveGroupName

Example         Dim objApp as object

Dim objViews as object

Dim objContact as object

Dim sGUID as string

 

'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

 

'Create a Views object.

Set objViews = objApp.Views

 

'Create the ContactView object.

Set objContact = objViews.Create(1, "MyContact")

 

'If the active group is not Activities, make it the active group.

If objContact.GetActiveGroup <> sGUID Then

 objContact.SetActiveGroup sGUID

End If

 

'Close the Contact view.

objContact.Close

Set objContact = Nothing

Set objViews = Nothing

'Close the Application object.

Set objApp = Nothing

GetActiveGroupName Method

Description    Gets the name of the active group. One group is designated as the active group in ACT! All new contacts are associated with the active group by default. Calling this method before adding a contact provides information about the group that the new contact will be associated with. Returns NULL on error.

Object            ContactView

Syntax            object.GetActiveGroupName

Return type   String/BSTR

GetLastError S_CON_DOC, S_ERROR, S_UNKNOWN

See also         GetActiveGroup, SetActiveGroup, SetActiveGroupName

Example         Dim objApp as object

Dim objViews as object

Dim objContact as object

Dim sGUID as string

 

'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

 

'Create a Views object.

Set objViews = objApp.Views

 

'Create the ContactView object.

Set objContact = objViews.Create(1, "MyContact")

 

'If the active group is not "Nuts and Things"

'then set the active group to "Nuts and Things".

If objContact.GetActiveGroupName <> "Nuts and Things" Then

   objContact.SetActiveGroupName ("Nuts and Things")

End If

 

'Close the Contact view.

objContact.Close

Set objContact = Nothing

Set objViews = Nothing

'Close the Application object.

Set objApp = Nothing

GetActiveTab Method

Description    Gets the text that appears on the currently active tab. Returns NULL on error.

Object            ContactView

Syntax            object.GetActiveTab

Return type   String/BSTR

GetLastError S_CON_DOC, S_NO_TAB_CONTAINER, S_UNKNOWN

See also         Activities, GroupMembership, NotesHistory, SetActiveTab

Example         'This example makes the Activities tab active.

Dim objApp as object

Dim objViews as object

Dim objContact 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

 

'Create a Views object.

Set objViews = objApp.Views

 

'Create the ContactView object.

Set objContact = objViews.Create(1, "MyContact")

 

'If the active tab is not Activities, set the active tab to Activities.

If objContact.GetActiveTab <> "Activities" Then

   objContact.SetActiveTab "Activities"

End If

 

'Close the Contact view.

objContact.Close

Set objContact = Nothing

Set objViews = Nothing

'Close the Application object.

Set objApp = Nothing

GetCount Method

Description    Gets the total number of contacts in the current lookup. Returns –1 on error.

Object            ContactView

Syntax            object.GetCount

Return type   Short Integer

GetLastError S_COUNT, S_UNKNOWN

GetCurrentID Method

Description    Returns the Unique ID of the current contact in the lookup. Returns NULL on error.

Note: If you are using a version of ACT! prior to ACT! 2000 version 5.0.2, this method activates the Contact View upon return. For ACT! 2000 version 5.0.2 or later, this method does not activate the Contact View. Use the Activate method to activate the Contact View if necessary.

Object            ContactView

Syntax            object.GetCurrentID

Return type   String/BSTR

GetLastError S_ERROR, S_UNKNOWN

Example         'This example lists all contacts and their Unique IDs.

 

Dim objApp as object

Dim objViews as object

Dim objContact as object

Dim i as integer

 

'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

 

'Create a Views object.

Set objViews = App.Views

 

'Create the ContactView object. This brings up the Contact view.

Set objContact = objViews.Create(1, "MyContact")

objContact.MoveFirst              'Move to the first contact.

 

'Go through all the contacts and list their Unique IDs.

For i = 1 To objContact.GetCount         'Get the number of contacts.

   List1.AddItem objContact.GetCurrentID 'List contact Unique ID.

   List1.AddItem objContact.GetField (CF_Name)

   objContact.MoveNext

Next i

 

'Close the Contact view.

objContact.Close

Set objContact = Nothing

Set objViews = Nothing

'Close the Application object.

Set objApp = Nothing

GetField Method

Description    Gets the value of the specified field in the current record. Returns NULL on failure.

Object            ContactView

Syntax            object.GetField(lFieldID)

Parameters    lFieldID                 A long integer representing the name of the field whose value is to be retrieved. See the ACT! Database File Formats Reference appendix for lists of field IDs and names (Field constants).

Return type   String/BSTR

GetLastError S_CON_DOC, S_UNKNOWN

See also         SetField

Example         See GetCurrentID.

GetTabCount Method (requires ACT! 4.0 or later)

Description    Returns the number of tabs in the Contact view, including tabs added using the Adding Extensible Views and Tabs to ACT! component of the ACT! SDK. Returns –1 on error.

Object            ContactView

Syntax            object.GetTabCount

Return type   Short Integer

GetLastError S_CON_DOC, S_NO_TAB_CONTAINER, S_UNKNOWN

See also         GetTabName

Example         'This example gets the number of tabs and the names of the tabs

'in the Contact view.

 

Dim objApp as object

Dim objViews as object

Dim objContact 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

 

'Create a Views object.

Set objViews = objApp.Views

 

'Create the ContactView object.

Set objContact = objViews.Create(1, "MyContact")

 

'List all the Tabs in the ContactView.

For i = 0 To objContact.GetTabCount - 1

   List1.AddItem "TabName " & objContact.GetTabName(i)

Next i

 

'Close the Contact view.

objContact.Close

Set objContact = Nothing

Set objViews = Nothing

'Close the Application object.

Set objApp = Nothing

GetTabName Method (requires ACT! 4.0 or later)

Description    Returns a string containing the name of the specified tab in the Contact view. Returns NULL on error.

Object            ContactView

Syntax            object.GetTabName(iTabNo)

Parameters    iTabNo                   A short integer that specifies the tab index number, in a range between 0 and one less than the value returned by GetTabCount.

Return type   String/BSTR

GetLastError S_CON_DOC, S_NO_TAB_CONTAINER, S_UNKNOWN

See also         GetTabCount

Example:        See GetTabCount.

Goto Method

Description    Makes the specified contact the current contact and displays it. Returns S_ERROR on failure.

Object            ContactView

Syntax            object.Goto(szContactID)

Parameters    szContactID           A string representing the Contact ID.

Return type   Long Integer

GetLastError S_CON_DOC, S_UNKNOWN

See also         MoveFirst, MoveLast, MoveNext, Moveprevious

GroupMembership Method

Description    Returns a dispatch pointer to a grid object for the Groups tab in the Contacts view. The Groups tab must be the active tab before calling this method. Returns NULL on error.

Object            ContactView

Syntax            object.GroupMembership

Return type   Object/LPDISPATCH

GetLastError S_CON_DOC, S_MEM_ERROR, S_NO_DALLIST_VIEW, S_UNKNOWN

See also         Activities, GetActiveTab, NotesHistory, SetActiveTab

Example         Set objCView = objViews.Create(1, "CV")

 

objCView.SetActiveTab "Groups"

'Create the Grid object for the grid on the Groups tab in the Contacts view.

Set objGM = objCView.GroupMembership

'List all the groups a contact belongs to.

For i = 0 To objGM .GetRowCount - 1

   List1.AddItem objGM .GetField(GF_Name, i)

Next i

 

Set objGM = Nothing

Set objCView = Nothing

LookupAll Method

Description    Creates and displays a lookup consisting of all contact records. The result of this lookup becomes the current lookup and the previous lookup is saved.

Object            ContactView

Syntax            object.LookupAll

Return type   Long Integer

GetLastError S_UNKNOWN, S_VW_NOT_FOUND

See also         LookupField, LookupMyRecord, LookupPrevious, RunQuery

LookupField Method (obsolete)

Use LookupFieldEx instead of this method.

LookupFieldEx Method (requires ACT! 4.0 or later)

Description    Creates and displays a contact lookup based on a specified field value. The result becomes the current lookup and the previous lookup is saved. Returns S_ERROR on failure.

Note: This method extends the functionality of LookupField in ACT! 4.0 or later.

Object            ContactView

Syntax            object.LookupFieldEx(lFieldID, szFieldValue, iType)

Parameters    lFieldID                 A long integer representing the field ID of the field to be used in the lookup. See the ACT! Database File Formats Reference appendix for lists of field IDs and names (Field constants).

szFieldValue          A string representing the field value to match. Only contacts with the specified field value in the specified field are retrieved.

iType                      A short integer indicating the action on the current lookup

The following table lists the values for this parameter.

Value

Setting

0

Add to the current lookup

1

Narrow the current lookup

n

Specify any other number to replace the current lookup

Return type   Long Integer

GetLastError S_CON_DOC, S_INVALID_ID, S_UNKNOWN

See also         LookupAll, LookupField, LookupMyRecord, LookupPrevious, RunQuery

Example         'Example of doing a lookup from the ContactView object.

 

Dim objContactView As Object

Dim ContactId As String

Dim k As Integer

Dim objApp As Object

 

'Open the database with the default database.

Set objApp = CreateObject("ACTOLE.APPOBJECT")

'Open a database.

objApp.OpenDB C:\My Documents\ACT\Database\ACT5demo.dbf

Set objViews = objApp.Views

Set objContactView = objViews.Create(1, "CL")

 

'Lookup all contacts with "Cordoba" in the company field.

objContactView.LookupFieldEx CF_Company, "Cordoba", 2

 

'Narrow the lookup to all contacts with a name starting with "Carl".

objContactView.LookupFieldEx CF_Name, "Carl", 1

If objContactView.GetCount = 0 then

   MsgBox "No names starting with Carl found"

Endif

Set objContactView = Nothing

Set objViews = Nothing

Set objApp = Nothing

LookupMyRecord Method

Description    Creates and displays a lookup consisting only of the current user’s My Record. The result of this lookup becomes the current lookup and the previous lookup is saved.

Object            ContactView

Syntax            object.LookupMyRecord

Return type   Long Integer

GetLastError S_UNKNOWN, S_VW_NOT_FOUND

See also         LookupAll, LookupField, LookupPrevious, RunQuery

LookupPrevious Method

Description    Returns the most recent lookup, which replaces the current lookup.

Object            ContactView

Syntax            object.LookupPrevious

Return type   Long Integer

GetLastError S_UNKNOWN, S_VW_NOT_FOUND

See also         LookupAll, LookupField, LookupMyRecord, RunQuery

MoveFirst Method

Description    Displays the first record in the current lookup.

Object            ContactView

Syntax            object.MoveFirst

Return type   Long Integer

GetLastError S_UNKNOWN, S_VW_NOT_FOUND

See also         BOL, EOL, MoveLast, MoveNext, Moveprevious

MoveLast Method

Description    Displays the last record in the current lookup.

Object            ContactView

Syntax            object.MoveLast

Return type   Long Integer

GetLastError S_UNKNOWN, S_VW_NOT_FOUND

See also         BOL, EOL, MoveFirst, MoveNext, Moveprevious

MoveNext Method

Description    Displays the next record in the current lookup. Returns S_NONE if the next record does not exist.

Object            ContactView

Syntax            object.MoveNext

Return type   Long Integer

GetLastError S_UNKNOWN, S_VW_NOT_FOUND

See also         BOL, EOL, MoveFirst, MoveLast, Moveprevious

Example         'This example displays the next record in the lookup.

objContact.MoveNext

If objContact.EOL then

   MsgBox "End of Contact List"

End If

Moveprevious Method

Description    Displays the previous record in the current lookup. Returns S_NONE if the previous record does not exist.

Object            ContactView

Syntax            object.Moveprevious

Return type   Long Integer

GetLastError S_UNKNOWN, S_VW_NOT_FOUND

See also         BOL, EOL, MoveFirst, MoveLast, MoveNext

NewContactDialog Method (requires ACT! 4.0 or later)

Description    Opens the Add Contact dialog box enabling the user to enter the information for a new contact. Returns S_OK if the user clicked OK after typing the contact name and any other contact information and S_ERROR if the user clicked Cancel.

Object            ContactView

Syntax            object.NewContactDialog

Return type   Long Integer

GetLastError S_UNKNOWN

Comments     This method will not return until the user closes the dialog box by clicking OK or Cancel.

See also         AddNewContact

NotesHistory Method

Description    Returns a dispatch pointer to a Grid object for the Notes/History tab in the Contacts view. Returns NULL on error.

Object            ContactView

Syntax            object.NotesHistory

Return type   Object/LPDISPATCH

GetLastError S_CON_DOC, S_MEM_ERROR, S_NO_DALLIST_VIEW, S_UNKNOWN

See also         Activities, GetActiveTab, SetActiveTab

RunQuery Method

Description    Loads and runs the specified saved query and creates and displays a lookup based on the query. Returns S_ERROR on failure.

Object            ContactView

Syntax            object.RunQuery(szQueryFile)

Parameters    szQueryFile           A string representing the complete path and file name of the file containing the query to be executed.

Return type   Long Integer

GetLastError S_CON_DOC, S_NOT_FOUND, S_UNKNOWN

See also         LookupAll, LookupField, LookupMyRecord, LookupPrevious

Example     'This example loads and runs MyQuery.qry.

 

Dim objApp as object

Dim objViews as object

Dim objContact 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

 

'Create a Views object.

Set objViews = App.Views

 

'Create the ContactView object. This brings up the Contact view.

Set objContact = objViews.Create(1, "MyContact")

 

'Run MyQuery. Contacts that meet the criteria are in the current lookup.

objGrp.RunQuery "C:\PROGRAM FILES\ACT\QUERY\MYQUERY.QRY"

 

'Close the Contact view.

objContact.Close

objViews.CloseAll

Set objContact = Nothing

Set objViews = Nothing

'Close the Application object.

Set objApp = Nothing

Sales Method (requires ACT! 2000 or later)

Description    Returns a dispatch pointer to the grid object for the Sales tab.

Object            ContactView

Syntax            object.Sales

Return type   Object/LPDISPATCH

See also         CompleteSale, CreateSalesForecast

Example         'The following sample lists Sales records for a specified contact.

Set objViews = objApp.Views

Set objContactView = objViews.CreateEx(1, "CV", 2)

'Select the Sales/Opportunities tab.

objContactView.SetActiveTab "Sales/Opportunities"

'Go to the contact for which to list the Sales records.

objContactView.Goto ContactId

'Set the Sales Grid object.

Set objSales = objContactView.Sales

List1.AddItem objSales.GetRowCount & " Sales for this Contact"

For i = 0 To objSales.GetRowCount - 1

   List1.AddItem objSales.GetField(SLF_Status, i) & "  " &

       objSales.GetField(SLVF_ProductName, i) & "  " &

       objSales.GetField(SLVF_TypeName, i) & "  " &

       objSales.GetField(SLF_SaleDate, i)

   List1.AddItem objSales.GetField(SLF_Units, i) & "  " &

       objSales.GetField(SLF_UnitPrice, i) & "  " &

       objSales.GetField(SLF_Amount, i) & " " &

       objSales.GetField(SLVF_Competitors, i)

Next i

SaveQuery Method

Description    Saves the current query in the specified .QRY file. Returns S_ERROR on failure.

Object            ContactView

Syntax            object.SaveQuery(szQueryFile)

Parameters    szQueryFile           A string representing the complete path and file name of the file where the query will be saved. Query files must have a .QRY extension.

Return type   Long Integer

GetLastError S_CON_DOC, S_UNKNOWN

SelectContactDlg Method (requires ACT! 4.0 or later)

Description    Opens the Associate with Contact dialog box with the specified text in the Item: field to enable the user to select a contact to associate with the item. Returns the Unique ID of the selected contact if the user clicked OK or NULL if the user clicked Cancel.

Object            ContactView

Syntax            object.SelectContactDlg(szText)

Parameters    szText                     A string representing the text to be displayed in the Item: field of the Associate with Contact dialog box.

Return type   String/BSTR

GetLastError S_UNKNOWN

Comments     This method will not return until the user closes the dialog box by clicking OK or Cancel.

Example         Set objViews = objApp.Views

Set objContactView = objViews.Create(1, "CV")

ContactId = objContactView.SelectContactDlg("Select a Contact")

objContactView.Goto ContactId

 

'Now you can do whatever you want with this contact,

'Add a note, activity, etc.

 

Set objContactView = Nothing

Set objViews = Nothing

SetActiveGroup Method

Description    Makes the group with the specified Unique ID active.

Object            ContactView

Syntax            object.SetActiveGroup(szGroupID)

Parameters    szGroupID             A string representing the Unique ID of the group to be made active.

Note: To make <No Group> the active group, specify an empty string.

Return type   Long Integer

GetLastError S_CON_DOC, S_UNKNOWN

See also         GetActiveGroup, GetActiveGroupName, SetActiveGroupName

Example         See GetActiveGroup.

SetActiveGroupName Method (requires ACT! 4.0 or later)

Description    Makes the group (specified by group name) active. One group is designated as the active group in ACT! All new contacts are associated with the active group by default. Calling this method before adding a contact ensures that the new contact is associated with the specified group.

Object            ContactView

Syntax            object.SetActiveGroupName(szGroupName)

Parameters    szGroupName        A string representing the name of the group to be made active.

Return type   Long Integer

GetLastError S_CON_DOC, S_UNKNOWN

See also         GetActiveGroup, GetActiveGroupName, SetActiveGroup

Example         See GetActiveGroupName.

SetActiveTab Method

Description    Makes the specified tab active. Returns S_ERROR on failure.

Object            ContactView

Syntax            object.SetActiveTab(szTabName)

Parameters    szTabName            A string representing the name of the tab to be made active.

Return type   Long Integer

GetLastError S_CON_DOC, S_INVALID_TAB, S_NO_TAB_CONTAINER, S_UNKNOWN

See also         Activities, GetActiveTab, NotesHistory

SetField Method

Description    Sets the value of the specified field in the current record. Returns S_ERROR on failure.

Object            ContactView

Syntax            object.SetField(lFieldID, szFieldValue)

Parameters    lFieldID                 A long integer representing the field ID of the field. See the ACT! Database File Formats Reference appendix for lists of field IDs and names (Field constants).

szFieldValue          A string representing the value to set in the specified field.

Return type   Long Integer

GetLastError S_CON_DOC, S_INVALID_INPUT, S_UNKNOWN

See also         GetField

Example         See AddNewContact.

TriggerActivitySeries Method (requires ACT! 2000 or later)

Description    Runs the specified activity series. Returns 0 if successful or an error code if unsuccessful. For a list of error codes, see the following chapter.

Object            ContactView

Syntax            object.TriggerActivitySeries (iLookupType, SeriesDate, szActivitySeriesName)

Parameters    iLookupType                A short integer representing the lookup type.

                                    The following table lists the values for this parameter:

Value

Type

 

Value

Type

0

All records

 

2

Current Lookup

1

Current record

 

3

Selected Group

 

SeriesDate                   A date representing the start date or due date for the activity series, formatted in Windows Regional Settings Short Date style.

szActivitySeriesName   A string specifying the file name and path for the activity series. Activity series files are stored in \ACT\Macro. The file extension must be .SER.

Return type   Long Integer

Example         'This example code schedules the "Test.ser" series with the current lookup

'and a start date of 9/11/99.

 

Set objViews = objApp.Views

Set objContactView = objViews.Create(1, "CL")

ret = objContactView.TriggerActivitySeries(1, "9/11/99",

   "c:\Program Files\ACT\Macro\Test.ser")

Set objContactView = Nothing


EmailView object methods

The EmailView object provides an interface to use the E-mail Inbox view in the ACT! application. The following methods apply only to the EmailView object. See “Common properties and methods” for properties and additional methods that apply to the EmailView object.

Methods

Method name

Parameter(s)

Parameter type(s)

Return type

GetActiveInbox

None

¾

String/BSTR

GetInboxCount

None

¾

Short Integer

GetInboxName

iInbox

Short Integer

String/BSTR

GetOpenFolderMessageCount

None

¾

Short Integer

MsgComposeView

None

¾

Object/LPDISPATCH

OpenInbox

szName

String

Long Integer

SetActiveInbox

szName

String

Long Integer

Sort

iColumn,
True|False

Short Integer,
Boolean

Long Integer

GetActiveInbox Method

Description    Returns the name of the currently active inbox in the E-mail view. The name returned is exactly as it appears on the view. Returns NULL on error.

Object            EmailView

Syntax            object.GetActiveInbox

Return type   String/BSTR

GetLastError S_GET_SELECTION_FAIL, S_NO_EMAIL

See also         SetActiveInbox

GetInboxCount Method

Description    Returns the number of inboxes set up in the E-mail view.

Object            EmailView

Syntax            object.GetInboxCount

Return type   Short Integer

GetLastError -1

GetInboxName Method

Description    Returns the name of the specified inbox. The name returned is exactly as it appears on the view. Returns NULL on an invalid index.

Object            EmailView

Syntax            object.GetInboxName(iInbox)

Parameters    iInbox                    A short integer representing the index.

Return type   String/BSTR

GetLastError S_NO_EMAIL

Comments     The inbox is specified through the index. Index begins at 0 (zero) to retrieve the name of the first inbox. Index can never exceed the count returned by GetInboxCount.

Example         'This example lists all the mail inbox names.

 

Dim objEmail as object

Dim objApp as object

Dim objViews as object

Dim i as integer

 

'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

 

Set objViews = App.Views

Set objEmail = objViews.Create(6, "Email")

 

'List all mail inboxes.

For i = 0 To objEmail.GetInboxCount - 1

   List1.AddItem objEmail.GetInboxName(i)

Next i

 

objEmail.Close

Set objEmail = Nothing

Set objViews = Nothing

'Close the Application object.

Set objApp = Nothing

GetOpenFolderMessageCount Method (requires ACT! 2000 or later)

Description    Gets the number of messages in the currently-open e-mail inbox.

Object            EmailView

Syntax           object.GetOpenFolderMessageCount

Return type   Short Integer

Example         Set objInbox = objViews.Create(6, "Email")

objInbox.OpenInbox ("cc:Mail")

 

'Get the number of messages in the cc:Mail inbox.

lstVerify.AddItem objInbox.GetOpenFolderMessageCount

MsgComposeView Method

Description    Returns a dispatch pointer to the E-mail compose view. Returns NULL on failure.

Object            EmailView

Syntax            object.MsgComposeView

Return type   Object/LPDISPATCH

Example         'This example returns a dispatch pointer to the E-mail compose view.

 

Dim objEmail as object

Dim objApp as object

Dim objViews as object

Dim objEComp 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

 

Set objViews = App.Views

Set objEmail = objViews.Create(6, "Email")

 

'Create the MsgComposeView.

Set objEComp = objEmail.MsgComposeView

 

'Close the Mail Compose view before closing E-mail Compose view.

objEComp.Close

 

objEmail.Close

Set objEmail = Nothing

Set objViews = Nothing

'Close the Application object.

Set objApp = Nothing

OpenInbox Method

Description    Opens the specified inbox in the E-mail view. Returns S_ERROR on failure.

Object            EmailView

Syntax            object.OpenInbox(szName)

Parameters    szName                  A string representing the name of the inbox in the E-mail view.

Return type   Long Integer

GetLastError S_FOLDER_OPEN_FAIL

See also         GetInboxName

SetActiveInbox Method

Description    Sets the specified inbox as the currently active inbox in the E-mail view. Returns S_ERROR on failure.

Object            EmailView

Syntax            object.SetActiveInbox(szName)

Parameters    szName                  A string representing the name of the inbox in the E-mail view.

Return type   Long Integer

GetLastError S_NO_EMAIL

See also         GetActiveInbox

Example         'This example sets cc:Mail to be the active inbox.

 

Dim objEmail as object

Dim objApp as object

Dim objViews 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

 

Set objViews = App.Views

Set objEmail = objViews.Create(6, "Email")

 

'If the Active Mailbox is not cc:Mail, then set cc:Mail to be active.

If objEmail.GetActiveInbox <> "cc:Mail" Then

   objEmail.SetActiveInbox ("cc:Mail")

End If

 

objEmail.Close

Set objEmail = Nothing

Set objViews = Nothing

'Close the Application object.

Set objApp = Nothing

Sort Method (requires ACT! 2000 or later)

Description    Sorts the e-mail inbox by the specified column in the order specified. Returns 0 if successful or an error code if unsuccessful. For a list of error codes, see the following chapter.

Object            EmailView

Syntax            object.Sort (iColumn, True|False)

Parameters    iColumn                 A short integer representing the column on which to sort the e-mail inbox. For example, specify 3 to sort by the From column, 4 for the Date column, or 5 for the Subject column.

True|False             Specify True to sort the specified column in descending order or False to sort it in ascending order.

Return type   Long Integer


ExplorerView object methods

The ExplorerView object provides an interface to use an Explorer view that was added to the ACT! application using the Adding Extensible Views and Tabs to ACT! component of the ACT! SDK. The following methods apply only to the ExplorerView object. See “Common properties and methods” for properties and additional methods that apply to the ExplorerView object.

Methods

Method name

Parameter(s)

Parameter type(s)

Return type

GetStartupURL

None

¾

String/BSTR

GetURL

None

¾

String/BSTR

GoBack

None

¾

Long Integer

GoForward

None

¾

Long Integer

Refresh

None

¾

Long Integer

SetURL

szURL

String

Long Integer

Stop

None

¾

Long Integer

The following sample Visual Basic code demonstrates how to use the ExplorerView object:

'A simple example demonstrating the use of the various methods.

 

Dim ExplView As object

 

'Get the Views object

Set objViews = objApp.Views

 

'Load the Floating View (7), which has MyWebSite as the title.

Set ExplView = objViews.FindExplorerView("MyWebSite", 7)

If objViews.GetLastError <> 0 Then

   MsgBox "Error loading the floating Explorer View, exiting"

   objViews.ClearError

   Exit Sub

End If

List1.AddItem "View Type : (Should be 7)" & ExplView.Type

'Get the address currently open.

List1.AddItem "Get URL :" & ExplView.GetURL

'Load the URL www.actsoftware.com.

ExplView.SetURL "www.actsoftware.com"

 

ExplView.Close

Set ExplView = Nothing

Set objViews = Nothing

GetStartupURL Method

Description    Returns the URL that the Explorer uses when it is launched.

Object            ExplorerView

Syntax            object.GetStartupURL

Return type   String/BSTR

See also         GetURL, SetURL

GetURL Method

Description    Returns the current URL from the Explorer. Returns NULL on error.

Object            ExplorerView

Syntax            object.GetURL

Return type   String/BSTR

GetLastError S_CON_DOC

See also         GetStartupURL, SetURL

GoBack Method

Description    Displays the contents of the previous URL in the history buffer. Returns S_OK.

Object            ExplorerView

Syntax            object.GoBack

Return type   Long Integer

GetLastError S_CON_DOC

See also         GoForward

GoForward Method

Description    Displays the contents of the next URL in the history buffer.

Object            ExplorerView

Syntax            object.GoForward

Return type   Long Integer

GetLastError S_CON_DOC

See also         GoBack

Refresh Method

Description    Refreshes the contents of the Explorer view using the current URL.

Object            ExplorerView

Syntax            object.Refresh

Return type   Long Integer

GetLastError S_CON_DOC

SetURL Method

Description    Sets the specified URL as the current URL for the Explorer.

Object            ExplorerView

Syntax            object.SetURL(szURL)

Parameters    szURL                    A string representing the new URL.

Return type   Long Integer

GetLastError S_CON_DOC

See also         GetURL

Stop Method

Description    Stops the Explorer from retrieving the contents of the current URL.

Object            ExplorerView

Syntax            object.Stop

Return type   Long Integer

GetLastError S_CON_DOC


Grid object methods

The Grid object provides an interface to use the Grid view in the ACT! application. The following methods apply only to the Grid object.

Methods

Method name

Parameter(s)

Parameter type(s)

Return type

BOL

None

¾

Boolean

DeleteRow

lRowNo

Long Integer

Long Integer

EOL

None

¾

Boolean

GetColumnCount

None

¾

Long Integer

GetColumnID

lColNo

Long Integer

Long Integer

GetColumnName

lColNo

Long Integer

String/BSTR

GetCurrentRow

None

¾

Long Integer

GetField

lFieldID,
lRowNo

Long Integer, Long Integer

String/BSTR

GetFilter

lFilters,
vDate,
vUserID

Long Integer,
Variant,
Variant

Long Integer

GetLastError

None

¾

Long Integer

GetRowCount

None

¾

Long Integer

GetRowNumber

szUniqueID

String

Long Integer

GetUniqueID

lRowNo

Long Integer

String/BSTR

Goto

lRowNo

Long Integer

Long Integer

MoveFirst

None

¾

Long Integer

MoveLast

None

¾

Long Integer

MoveNext

None

¾

Long Integer

Moveprevious

None

¾

Long Integer

RefreshGrid

None

¾

Long Integer

SelectRow

lRowNo,
bReserved

Long Integer,
Boolean

Long Integer

SetField

lFieldID,
lRowNo,
szFieldValue

Long Integer,
Long Integer,
String

Long Integer

SetFilter

lFilters, szDate,
szUserID…

Long Integer
String, String

Long Integer

Sort

lFieldID,
True|False

Long Integer, Boolean

Long Integer

BOL Method

Description    Returns True if the current record is the first in the grid or False if it is not the first in the grid or on error.

Object            Grid

Syntax            object.BOL

Return type   Boolean

GetLastError S_NO_DALLIST_VIEW, -2

See also         EOL, Goto, MoveFirst, MoveLast, MoveNext, Moveprevious

Example         Dim objApp as object

Dim objContactListView as object

Dim objContactListGrid 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

 

Set objViews = objApp.Views

 

'Create the Contact List view.

Set objContactListView = objViews.Create(2, "CL")

 

'Create the Grid object for the Contact List.

Set objContactListGrid = objContactListView.GetGrid

If objContactListGrid.BOL <> True Then

   objContactListGrid.MoveFirst

Else

   MsgBox "Beginning of List"

End If

 

Set objContacttListGrid = Nothing

objContacttListView.Close

Set objCtListView = Nothing

Set objViews = Nothing

'Close the Application object.

Set objApp = Nothing

DeleteRow Method

Description    Deletes the specified record from the grid and table. Use the SelectRow method or go to the row to be deleted before using this method. This method cannot be used on Grid object for Group Membership tab (Contact view) or Contact tab (Group view). Returns S_ERROR on failure.

Object            Grid

Syntax            object.DeleteRow(lRowNo)

Parameters    lRowNo                  A long integer representing the row of the record to be deleted, in the range between 0 (zero) and one less than the value of the row count.

Return type   Long Integer

GetLastError S_DELETE_FAIL, S_DELETE_NOTALLOWED, S_INVALID_INPUT, S_NO_DALLIST_VIEW, -2

See also         GetRowCount

EOL Method

Description    Returns True if the current record is at the last in the grid and False if it is not the last in the grid or on error.

Object            Grid

Syntax            object.EOL

Return type   Boolean

GetLastError S_NO_DALLIST_VIEW, -2

Example         Dim objApp as object

Dim objContactListView as object

Dim objContactListGrid 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

 

Set objViews = objApp.Views

 

'Create the Contact List view.

Set objContactListView = objViews.Create(2, "CL")

 

'Create the Grid object for the Contact List.

Set objContactListGrid = objContactListView.GetGrid

If objContactListGrid.EOL <> True Then

   objContactListGrid.MoveLast

Else

   MsgBox "End of List"

End If

 

Set objContacttListGrid = Nothing

objContacttListView.Close

Set objCtListView = Nothing

Set objViews = Nothing

'Close the Application object.

Set objApp = Nothing

GetColumnCount Method

Description    Returns the total number of columns in the grid. Returns -1 on failure. Use GetLastError to get information on an error.