I am trying to modify an existing SP2010 custom workflow action that converts an existing document to PDF using Word Automation. There is a new requirement to only convert the last published version of a document to PDF. I have been able to iterate through the file versions and find the last published version without too much trouble, but the problem is that when I pass the _vti_history version of the URL to the Word Automation ConversionJob.AddFile() method it generates a "Microsoft.SharePoint.SPException: List does not exist" error.
The latest version url is "http://myvm/Draft Documents/Test test test.docx"
The latest published version url is "http://myvm/_vti_history/2048/Draft Documents/Test test test.docx"
I am able to enter the URL for the latest published version in the browser and it opens the correct version of the document just fine.
Seeing the AddFile() method is not overloaded and only accepts (string inputURL, string outputUrl), does anyone wnow how I can get a previous version converted to PDF without having to write to a temporary file?