2017-01-24 6 views
0

5 분마다 소스에서 자동으로 업데이트되는 파워 포인트 슬라이드를 만들고 싶습니다. 웹 사이트로 브로드 캐스트 서비스를 시작합니다 (&은 계속해서 내용을 새로 고침).Powerpoint 2010 - broadcast.start()

나는 방송을 시작하지만, 런타임 오류가 계속 다음이 코드를 사용하여 시도했다 : 는 "클라이언트 : SoapReader에 요청을로드 실패 ..."

Sub ShowIt() 
    Application.ActivePresentation.SlideShowSettings.Run 
    Application.ActivePresentation.Broadcast.Start ("https://bn1-broadcast.officeapps.live.com/") 
    DoEvents 
    End Sub 

broadcast.start을 (수행 방법) 작동합니까? 이 사용자 상호 작용이 필요로

+0

msdn [Presentation.Broadcast] (https://msdn.microsoft.com/ko-kr/library/office/ff744901(v = office.14) .aspx) 속성에는 많은 설명서가 없습니다. ,하지만 당신의 코드를 시험해 보면 로그인 프롬프트가 있습니다. 당신이 그것을 가지고 있지 않다면, 나는 저장된 자격 증명이 오래되었다는 것을 추측하고 그 오류를 얻는다. 기본적으로 당신은 귀하의 프레 젠 테이션이 보여주는 무엇이든 그 URL을 먹이 있습니다. 완료되면'.Broadcast.End'도 추가해야합니다. – PatricK

답변

0

이 프로그래밍 방식으로 UI를 복제하지만 난 당신이하고 싶지 않아 같아요 도움이 될 수있는

Application.CommandBars.ExecuteMso "BroadcastSlideShow" 

두 반 유용한 링크 패트릭이 지적 하듯, 문서 [있지만, 작동 예제가 있음]을 찾는 것이 불가능한 것 같습니다.

Broadcast Methods & Properties on MSDN 기타 버전 링크에는 2010 년 하위 집합이 더 작습니다.

Microsoft Community Discussion on Broadcast via VBA

난 가능한 멀리로하지 않았다 나는 "실패 개체의 방법 '시작' '방송'의"오류가 발생합니다. 나는 그 파워 포인트 2016 UI (슬라이드 쇼/현재 온라인)을 통해 브로드 캐스트 세션을 시작하고 서비스 URL 돌아가려면 직접 실행 창에 다음을 사용 :

?ActivePresentation.Broadcast.PresenterServiceUrl 

을이에 돌려 ASMX 파일 참조 지역화 된 도메인 :

https://ie1-broadcast.officeapps.live.com/m/present_2_0.asmx 

그러나 .Start 메서드를 사용하면 여전히 동일한 오류가 반환됩니다. OneDrive 위치에 저장하는 것과 같은 일부 준비 작업 (UI를 사용할 때 본 것처럼)을 수행해야하는지 궁금합니다.

PowerPoint 2016 (PC)을 사용하여 UI 온라인 명령을 호출 한 후 Enter 키를 두 번 눌러서 Present 온라인 서비스에 연결하고 VBA 스레드 독립적 타이머 용 WinAPI를 사용하여 슬라이드 쇼를 시작했습니다. CONNECT 단추와 시작 프레젠테이션 단추 (표시되는 PowerPoint 창은 모달이며 실행은 VBA로 반환되지 않으므로 DoEvents를 사용할 수 없습니다. 프레젠테이션을 시작하고 연결 준비 사이에 준비 시간이 필요합니다. 내 간단한 슬라이드 데크가 10 초 미만 이었지만 내용에 따라 TimerProc 절차에서 상수를 ENTER2으로 변경해야 할 수도 있습니다. 분명히 이것은 약간의 히트와 미스 (SendKeys 사용 및 알 수없는 시간 때문에) 그래서 나는 여전히 더 나은 메커니즘을 찾고 있어요. 이 예에서는 Debug.Print 문으로 출력되는 참석자 URL을 공유하는 방법을 결정해야합니다. StartBroadcast 절차를 실행하기 만하면됩니다.

' ====================================================== 
' =========== PowerPoint VBA Standard Module =========== 
' ====================================================== 
' Purpose : Starts a "Present Online" broadcast session. 
' Prerequisites : Access to Present Online service. 
' Platform : Tested with PowerPoint 2016 (PC) only. 
' Author : Jamie Garroch of YOUpresent Ltd. 24JAN2017 
'   http:\\youpresent.co.uk 
' References : None 
' ====================================================== 

Option Explicit 

#If VBA7 Then 
Public TimerID As LongPtr 
Public TimerCycles As LongPtr 
#Else 
Public TimerID As Long 
Public TimerCycles As Long 
#End If 

#If VBA7 Then 
Private Declare PtrSafe Function SetTimer Lib "user32" _ 
      (ByVal hwnd As LongPtr, _ 
      ByVal nIDEvent As LongPtr, _ 
      ByVal uElapse As LongPtr, _ 
      ByVal lpTimerFunc As LongPtr) As LongPtr 

Private Declare PtrSafe Function KillTimer Lib "user32" _ 
      (ByVal hwnd As LongPtr, _ 
      ByVal nIDEvent As LongPtr) As LongPtr 
#Else 
Private Declare Function SetTimer Lib "user32" _ 
      (ByVal hwnd As Long, _ 
      ByVal nIDEvent As Long, _ 
      ByVal uElapse As Long, _ 
      ByVal lpTimerFunc As Long) As Long 

Private Declare Function KillTimer Lib "user32" _ 
      (ByVal hwnd As Long, _ 
      ByVal nIDEvent As Long) As Long 
#End If 

' Run this procedure to start the broadcast session 
Sub StartBroadcast() 
    ActivePresentation.Windows(1).Activate 
    CommandBars.ExecuteMso "BroadcastSlideShow" 
    StartTimer 
End Sub 

Public Function StartTimer() 
    TimerID = SetTimer(0, 0, 1000, AddressOf TimerProc) 
    If TimerID = 0 Then Debug.Print "Timer not created.": Exit Function 
    Debug.Print "Timer " & TimerID & " started at : " & Now 
End Function 

Private Sub TimerProc(ByVal hwnd As Long, _ 
       ByVal uMsg As Long, _ 
       ByVal idEvent As Long, _ 
       ByVal dwTime As Long) 

    TimerCycles = TimerCycles + 1 

    Debug.Print "Timer " & TimerID & " running : " & TimerCycles 

    ' Number of seconds to wait before pressing ENTER the first time 
    ' to simulate pressing the "CONNECT" button 
    Const ENTER1 = 1 
    ' Number of seconds to wait before pressing ENTER the first time 
    ' to simulate pressing the "START PRESENTATION" button 
    Const ENTER2 = 10 

    ' Clicks the "CONNECT" button after ENTER1 seconds 
    If TimerCycles = ENTER1 Then SendKeys "{enter}" 

    ' Clicks the "START PRESENTATION" button after ENTER2 seconds 
    If TimerCycles = ENTER2 Then SendKeys "{enter}" 

    ' Output the Attendee URL for sharing and kill the timer 
    If TimerCycles > ENTER2 Then 
    Debug.Print ActivePresentation.Broadcast.AttendeeUrl 
    StopTimer 
    End If 
End Sub 

Public Function StopTimer() 
#If VBA7 Then 
    Dim tmpTimerID As LongPtr 
#Else 
    Dim tmpTimerID As Long 
#End If 
    tmpTimerID = TimerID 
    TimerID = KillTimer(0, TimerID) 
    If TimerID = 0 Then 
    Debug.Print "Couldn't kill the timer" 
    Else 
    Debug.Print "Timer " & tmpTimerID & " stopped at : " & Now & " with " & TimerCycles & " cycles" 
    End If 
    TimerCycles = 0 
    TimerID = 0 
End Function 
+0

안녕하세요 제이미, 위의 답변 주셔서 대단히 감사합니다. 잘 작동한다. 나는 그것이 올 때마다 정적 주소가 필요할 때 URL이 바뀔 것이라는 것을 알게되었습니다. – Hamish

+0

전체 프로젝트에서 일부 동적 데이터를 가져 와서 Excel로 가져온 다음 차트로 변환합니다 (매 5 분마다). 그때 나는 그것을 온라인으로 방송/스트림 할 수 있기를 원했다. Powerpoint는 Excel에 연결하여 차트를 가져올 수 있지만 브로드 캐스트를 끝내지 않고는 업데이트 할 수 없습니다. 새 URL이있을 때마다 최종 사용자에게 동일한 URL로 스트리밍 할 수 없습니다. – Hamish

+0

예, 브로드 캐스트는 세션 기반이므로 세션 ID 및 따라서 참석자 URL은 각 브로드 캐스트 세션마다 고유합니다. DataPoint 추가 기능을 사용하여 슬라이드 쇼 중에 콘텐츠를 동적으로 업데이트 할 수 있습니다. 나는 수년간 그것을 사용하지 않았지만 회사 제품에 깊은 인상을 받았습니다 (나는 그들과 관계가 없습니다). https://www.presentationpoint.com/software/datapoint/ –