C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[69793] 파워포인트 파일작업위해 OleVariant
bangco [] 2312 읽음    2013-07-08 13:31
안녕하세요.
파워포인트 파일이 수천개 있고(약 3천개) 그중에서 사용자가 임의로 선택하는 특정 파워포인트파일 5~6개를
불러와서 사용자가 지정한 순서대로 하나의 파워포인트파일로 병합하여 저장하는 프로그램을 C++빌더로
작성하려고 합니다.
파워포인트 파일 조작관련하여 구글에 찾아보니 아래와 같이 델파이 예제소스가 있더군요.
델파이로 돌려보면 잘 작동합니다.
근데 이 소스를 어떻게 하면 C++빌더로 바꿀 수 있을까요?
ComObj.hpp를 인클루드하고 각 파스칼 문장을 C++로 변환해봤는데
델파이와는 달리 각 문장이 멤버함수가 아니라는 에러가 뜹니다. ^^

------------------------------------------------------------------------------------
uses
  comobj;
 
procedure TForm1.Button2Click(Sender: TObject);
var
  PowerPointApp: OLEVariant;
begin
  try
    PowerPointApp := CreateOleObject('PowerPoint.Application');
  except
    ShowMessage('Error...');
    Exit;
  end;
  // Make Powerpoint visible
  PowerPointApp.Visible := True;

  // Show powerpoint version
  ShowMessage(Format('Powerpoint version: %s',[PowerPointApp.Version]));

  // Open a presentation
  PowerPointApp.Presentations.Open('c:\MyPresentation.ppt', False, False, True);

  // Show number of slides
  ShowMessage(Format('%s slides.',[PowerPointApp.ActivePresentation.Slides.Count]));

  // Run the presentation
  PowerPointApp.ActivePresentation.SlideShowSettings.Run;

  // Go to next slide
  PowerPointApp.ActivePresentation.SlideShowWindow.View.Next;

  // Go to slide 2
  PowerPointApp.ActivePresentation.SlideShowWindow.View.GoToSlide(2);

  // Go to previous slide
  PowerPointApp.ActivePresentation.SlideShowWindow.View.Previous;

  // Go to last slide
  PowerPointApp.ActivePresentation.SlideShowWindow.View.Last;

  // Show current slide name
  ShowMessage(Format('Current slidename: %s',[PowerPointApp.ActivePresentation.SlideShowWindow.View.Slide.Name]));
 
  // Close Powerpoint
  PowerPointApp.Quit;
  PowerPointApp := UnAssigned;
end;
-----------------------------------------------------------------------------------------------


+ -

관련 글 리스트
69793 파워포인트 파일작업위해 OleVariant bangco 2312 2013/07/08
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.