Click here to Skip to main content
15,887,346 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
C#
I have Power Point Presentation file containing embeded video. In C#, I written logic to convert the PPT file into MP4 video.

C#
Microsoft.Office.Interop.PowerPoint.Presentation objTempPresentation = appPpt.Presentations.Open(FileName, Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoFalse);  
objTempPresentation.CreateVideo(Mp4VideoName, false, 5, 480, 25, 75);  
while (objTempPresentation.CreateVideoStatus == PpMediaTaskStatus.ppMediaTaskStatusInProgress)  
{  
   Thread.Sleep(100);  
}  

C#
It is working fine.
Now I want to execute that exe in windows task scheduler so that it will convert the Uploaded PPT/PPTX files to video on regular interval.

For the windows task scheduler the property is selected as "Run only when user is logged on."

It is working fine, able to convert PPT/PPTX files to MP4 video of any size.

The Issue is:-

This is done on "Azure Server", so I want this exe must be executed if user is logged on or not.

So for that I have set windows task scheduler property as "Run whether user is logged on or not"And Now the video is not generated correctly. It is creating only 5 seconds video of still image.

I am not sure why is this happening. Why video are not generating of full length when user is not logged in on Azure server.

Please let me know if any one have any idea about this. Thanks in advance.


What I have tried:

I run this scheduler as "Run only when user is logged on". Its working fine.

I guess, in other mode the some services which are required to convert PPT/PPTX video to Mp4 video are not running while user is not logged in.
Posted
Updated 5-Jul-16 3:47am

1 solution

The problem is that you're using Pointpoint Interop. Unless you have this running in a virtual machine with PowerPoint installed it's not going to work.

Also, Office applications are NOT supported when running in a non-user interactive session, like a Windows Server, web application or a scheduled job running as anything other than a logged in user.
 
Share this answer
 
Comments
kanase.ranjit 11-Jul-16 3:53am    
Hi Dave,

Thanks for your replay,


On Virtual Machine Microsoft Office 2013 is already Installed. I am really stuck due to this issue.
Dave Kreskowiak 11-Jul-16 8:40am    
Again, if this is running in a non-interactive session, i.e. NOT on the logged in users desktop, it's not going to work.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900