Beispiel #1
0
	def _getPpObjectModelFromROT(self,useRPC=False):
		if not self._ppApplicationFromROT:
			try:
				self._ppApplicationFromROT=comHelper.getActiveObject(u'powerPoint.application',dynamic=True,appModule=self if useRPC else None)
			except:
				log.debugWarning("Could not get active object via RPC")
				return None
		try:
			pres=self._ppApplicationFromROT.activePresentation
		except (comtypes.COMError,NameError,AttributeError):
			log.debugWarning("No active presentation")
			return None
		try:
			ppSlideShowWindow=pres.slideShowWindow
		except (comtypes.COMError,NameError,AttributeError):
			log.debugWarning("Could not get slideShowWindow")
			ppSlideShowWindow=None
		isActiveSlideShow=False
		if ppSlideShowWindow:
			try:
				isActiveSlideShow=ppSlideShowWindow.active
			except comtypes.COMError:
				log.debugWarning("slideShowWindow.active",exc_info=True)
		if isActiveSlideShow:
			return ppSlideShowWindow
		try:
			window=pres.windows.item(1)
		except (comtypes.COMError,NameError,AttributeError):
			window=None
		return window
Beispiel #2
0
	def _getPpObjectModelFromROT(self,useRPC=False):
		if not self._ppApplicationFromROT:
			try:
				self._ppApplicationFromROT=comHelper.getActiveObject(u'powerPoint.application',dynamic=True,appModule=self if useRPC else None)
			except:
				log.debugWarning("Could not get active object via RPC")
				return None
		try:
			pres=self._ppApplicationFromROT.activePresentation
		except (comtypes.COMError,NameError,AttributeError):
			log.debugWarning("No active presentation")
			return None
		try:
			ppSlideShowWindow=pres.slideShowWindow
		except (comtypes.COMError,NameError,AttributeError):
			log.debugWarning("Could not get slideShowWindow")
			ppSlideShowWindow=None
		isActiveSlideShow=False
		if ppSlideShowWindow:
			try:
				isActiveSlideShow=ppSlideShowWindow.active
			except comtypes.COMError:
				log.debugWarning("slideShowWindow.active",exc_info=True)
		if isActiveSlideShow:
			return ppSlideShowWindow
		try:
			window=pres.windows.item(1)
		except (comtypes.COMError,NameError,AttributeError):
			window=None
		return window
Beispiel #3
0
 def getLambdaObj(self):
     if not self._oLambda:
         self.empty = ''
         oLambda = comHelper.getActiveObject(self._LambdaObjName,
                                             dynamic=True)
         if (oLambda):
             self._oLambda = oLambda
             self.empty = self._oLambda.getnone()
     return self._oLambda
Beispiel #4
0
 def getBme2ComObj(self):
     if not self._bme2ComObj:  # and not bme2ComObj:
         self.empty = ""
         bme2ComObj = comHelper.getActiveObject(self._BME2COMOBJNAME,
                                                dynamic=True)
         if bme2ComObj:
             self._bme2ComObj = bme2ComObj
             self.empty = self._bme2ComObj.getNone()
     return self._bme2ComObj
Beispiel #5
0
	def _get_nativeOm(self):
		try:
			nativeOm=comHelper.getActiveObject("outlook.application",dynamic=True)
		except (COMError,WindowsError,RuntimeError):
			if self._hasTriedoutlookAppSwitch:
				log.error("Failed to get native object model",exc_info=True)
			nativeOm=None
		if not nativeOm and not self._hasTriedoutlookAppSwitch:
			self._registerCOMWithFocusJuggle()
			return None
		self.nativeOm=nativeOm
		return self.nativeOm
Beispiel #6
0
	def _get_nativeOm(self):
		try:
			nativeOm=comHelper.getActiveObject("outlook.application",dynamic=True)
		except (COMError,WindowsError,RuntimeError):
			if self._hasTriedoutlookAppSwitch:
				log.error("Failed to get native object model",exc_info=True)
			nativeOm=None
		if not nativeOm and not self._hasTriedoutlookAppSwitch:
			self._registerCOMWithFocusJuggle()
			return None
		self.nativeOm=nativeOm
		return self.nativeOm