Frank Schindler
Posts: 2
Joined: 2006-03-15
|
Hi all,
I'm trying to open a Word document from inside a Add-in and always a EOleSysError exception 'Type conflict' is fired.
My source:
procedure TAddInModule.bicOpenDocAction(Sender: TObject);
var
ANull : OleVariant;
AFile : OleVariant;
begin
// ceUtils.DLLPath := COMAddInClassFactory.FilePath;
// ceUtils.HostType := HostType;
// ceOpenWizardForm := TceOpenWizardForm.Create(nil);
try
// if ceOpenWizardForm.ShowModal = mrOK then
begin
AFile := '"I:ProjekteListecContentExplorerDelphi SourceSerachDocsFOS_GRID_DATA_MODEL.doc"';
// AFile := ceOpenWizardForm.FileName;
case HostType of
ohaExcel : ExcelApp.Workbooks.Open(AFile,
Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null,
Null, -1);
ohaWord : WordApp.Documents.Open(AFile,
ANull, ANull, ANull, ANull,
ANull, ANull, ANull, ANull, ANull, ANull,
ANull);
ohaPowerPoint : PowerPointApp.Presentations.Open(AFile,
Null, Null, Null);
end;
end;
finally
FreeAndNil(ceOpenWizardForm);
end;
end;
What am I doing wrong?
TIA,
Frank |
|
Dmitry Kostochko
Add-in Express team
Posts: 2875
Joined: 2004-04-05
|
Hi Frank,
Try to use the EmptyParam variable instead of NULL or ANull.
|
|
Frank Schindler
Posts: 2
Joined: 2006-03-15
|
Hi Dmitry,
thanks a lot. It worked.
|
|