OLE automation object methods call using named parameters not work in FPC 3.2.0
Original Reporter info from Mantis: tsknv
-
Reporter name: Sergey Tsukanov
Original Reporter info from Mantis: tsknv
- Reporter name: Sergey Tsukanov
Description:
...
w := CreateOleObject('Word.Application');
...
w.Documents.Add(NewTemplate:=true); // this works only in FPC 3.0.4(Lazarus 2.0.8), in FPC 3.2.0 (Lazarus 2.0.10) get error "Method 'Add' is not supported by automation object"
Steps to reproduce:
Create new application in Lazarus 2.0.10 and place button in form... or use attached file
Button OnClick handler:
procedure TForm1.Button1Click(Sender: TObject);
var w:variant;
begin
w := CreateOleObject('Word.Application');
w.Visible := true;
{
https://docs.microsoft.com/ru-ru/office/vba/api/word.documents.add
Word.Documents.Add (Template, NewTemplate, DocumentType, Visible)
}
//w.Documents.Add(,true); //no errors, this works in FPC 3.0.4(Lazarus 2.0.8) and FPC 3.2.0 (Lazarus 2.0.10)
w.Documents.Add(NewTemplate:=true); // this works only in FPC 3.0.4(Lazarus 2.0.8), in FPC 3.2.0 (Lazarus 2.0.10) get error "Method 'Add' is not supported by automation object"
w := UnAssigned;
end;
Mantis conversion info:
- Mantis ID: 37355
- Version: 3.2.0
- Fixed in version: 3.2.2
- Fixed in revision: 45974 (#b412259c) merged 46278 (#1e64c994)
- Monitored by: » tsknv (Sergey Tsukanov), » @PascalDragon (Sven Barth)
- Target version: 3.2.2