2011-05-02 5 views
3

Word Automation Services의 실행/시작을 프로그래밍 방식으로 강제로 수행하는 방법은 무엇입니까?
변환 프로세스를 제출하면 시작/실행해야합니다.Word Automation Services를 프로그래밍 방식으로 실행하는 방법?

string siteUrl = "http://localhost"; 
    string wordAutomationServiceName = "Word Automation Services"; 
    using (SPSite spSite = new SPSite(siteUrl)) 
    { 
     ConversionJob job = new ConversionJob(wordAutomationServiceName); 
     job.UserToken = spSite.UserToken; 
     job.Settings.UpdateFields = true; 
     job.Settings.OutputFormat = SaveFormat.PDF; 
     job.AddFile(siteUrl + "/Shared%20Documents/Test.docx", siteUrl + "/Shared%20Documents/Test.pdf"); 
     job.Start(); 
    } 

답변

2

Word Automations Services 관리자 설정에서 지정한 시간 간격을 기다리지 않고 작업을 즉시 실행하는 방법이 있는지 묻습니다. 현재 SP 2010 용 Word Automation Services에는이 작업을 수행 할 수있는 방법이 없습니다. 내가 생각할 수있는 모든 것은 시간 간격을 최소 1 분 (기본값 15 분이 아닌)으로 변경하는 것입니다.

4

예, 은 중앙 관리 UI뿐만 아니라 코드에서 작업이 즉시 시작되도록합니다. 내 솔루션을 참조하십시오 (RunNow 메서드의 SPJobDefinition 클래스의 상단에 빌드 됨) here.

Word Automation Services 타이머 작업을 시작해야합니다.

$watj = Get-SPTimerJob "Word Automation Service Application" 
$watj.RunNow() 

또는 짧은 :

Start-SPTimerJob "Word Automation Services" 
PowerShell을 사용 eaxmple를 들어

,

관련 문제