OOps, the code below works with the addition of adding the line
VarClear(WordApp); before I start working with it!
Does anyone know why I would have to clear a variable before I start
working with it in a procedure?
Jason
-----Original Message-----
From: Jason Coley [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 20 July 2000 9:15 a.m.
To: Multiple recipients of list delphi
Subject: [DUG]: Problem with Norton Antivirus
I have an Outlook addin that opens Word using OLE calls GetOleObject and
if this fails uses CreateOLEObject, but when Nortons Antivirus is
installed the call to CreateOleObject does not return the pointer to the
application. The code I am using is below, I guess i need to know if
anyone else has had this problem with Nortons Antivirus. I am using
Antivirus 2000 and the code below works, but on another machine with
Antivirus 5.01 the code below doesn't work.
var
WordApp: OLEVariant;
begin
//Create WordApp
try
WordApp := GetActiveOLEObject('Word.Application');
except
try
WordApp := CreateOLEObject('Word.Application');
except
end;
end;
//Get WordApp if WordApp is still empty
If VarIsEmpty(WordApp) then
begin
try
WordApp := GetActiveOLEObject('Word.Application');
except
end;
end;
end;
Can anyone help?
Jason
------------------------------------------------------------------------
---
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz