1) Process 를 이용해서 Powerpoint 를 실행

    1         Dim MyStartInfo As New Diagnostics.ProcessStartInfo(strFileName)

    2 

    3         Dim MyProcess As New Diagnostics.Process

    4         MyProcess.StartInfo = MyStartInfo

    5         MyProcess.Start()


2) PowerPoint 의 instance 를 생성하여 선언한 변수에 할당

    1 

    2         Dim app As Microsoft.Office.Interop.PowerPoint.Application

    3         Dim pre As Microsoft.Office.Interop.PowerPoint.Presentation

    4 

    5         'app = DirectCast(GetObject("Powerpoint.Application"), Microsoft.Office.Interop.PowerPoint.Application)

    6         app = DirectCast(CreateObject("Powerpoint.Application", ""), Microsoft.Office.Interop.PowerPoint.Application)

    7 

    8         app = New Microsoft.Office.Interop.PowerPoint.Application()

    9 

   10         Pre = app.Presentations.Open(strFileName, Microsoft.Office.Core.MsoTriState.msoTrue, Microsoft.Office.Core.MsoTriState.msoTriStateMixed, 0)


3) 1)을 이용해서 생성한 PowerPoint 의 instance 를 BindToMoniker 를 이용해서 선언한 변수에 할당

    1         Dim MyStartInfo As New Diagnostics.ProcessStartInfo(strFileName)

    2         Dim MyProcess As New Diagnostics.Process

    3 

    4         MyProcess.StartInfo = MyStartInfo

    5         MyProcess.Start()

    6 

    7         Dim pre As Microsoft.Office.Interop.PowerPoint.Presentation

    8 

    9         pre = DirectCast(System.Runtime.InteropServices.Marshal.BindToMoniker(strFileName), Microsoft.Office.Interop.PowerPoint.Presentation)



흠... 그런데 안타까운 것은 위 모든 방법들이 XP 에서는 통용이 되지만
Window7 으로 올라와서는 Error 를 발생한다는 것.
간단한 예제에서는 에러 없이 실행이 되지만 많은 COM 들 속에서는 에러를 발생한다는 것.
하나하나 잡아야 하는 숙제가 있긴 하지만 많은 Case 를 테스트해 나가야하는 숙제가 남아 있다.

각 OS 에 대한, 각 Office Version 에 대한 Test를 진행해야한다.

대표적인 에러는
다음과 같다.


으잉? Monikor 에 대한 에러메세지만 있네...

다른 에러메세지는 캡쳐해서 다시 올리겠습니다.^^'


행복한 고수되십시요...

반응형

+ Recent posts