我只是想通過這樣做,使一個空的幻燈片對象 -如何創建一個空的幻燈片對象?
Microsoft.Office.Interop.PowerPoint.Slide empty_slide = new Microsoft.Office.Interop.PowerPoint.Slide();
的錯誤是:
Unhandled Exception: System.Runtime.InteropServices.COMException: Retrieving the
COM class factory for component with CLSID {91493445-5A91-11CF-8700-00AA0060263
B} failed due to the following error: 80040154 Class not registered (Exception f
rom HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOn
ly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Bo
olean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipChec
kThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean s
kipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at Program.GetBulletPointTransition(Application PowerPoint_App, Presentation
presentation) in c:\Users\PEAK\Documents\Peak Sourcing\Work\ppt_test\ppt_test\Pr
ogram.cs:line 539
at Program.Main(String[] args) in c:\Users\PEAK\Documents\Peak Sourcing\Work\
ppt_test\ppt_test\Program.cs:line 79
Press any key to continue . . .
我希望得到一些幫助。
你爲什麼把它設置爲null? null與空幻燈片不同!什麼是錯誤? – dotctor
這就像'沒有設置爲對象的實例'。好的,我應該怎麼做? – user1394252
'var empty_slide = new Microsoft.Office.Interop.PowerPoint.Slide();' – dotctor