Dynamically load and use COM object in C# -
i have c# project, access ms outlook, if installed on client´s machine. "access outlook" part has been done referencing outlook com object, , going there. problem "if installed" part. @ moment, project doesn´t compile on machines without outlook installed, assume have not reference outlook component, , instead load , use dynamically, after detecting outlook present, haven´t found way this. correct, , have hints on how this?
thanks.
edit: resolved. following advice given hans passant in 1 of comments using office pias, proved path of least resistance. had little difficulty getting pias on office-less machine, overcome using accepted answer this question.
you won't able compile assembly on machine without outlook com object being present, doesn't mean application fail work on machine without outlook - attempting create or use outlook com object result in failure / exception being thrown.
according this question best way of detecting whether or not com object present attempting instantiate , catching resulting exception in case not installed.
Comments
Post a Comment