1

I used Open XML + Word Automation to generate a word file from template and convert it to pdf. Now both word documents and generated PDFs are in the same document library. The word documents has some properties, which is added when they are created/uploaded to the library.

What I try to do now is automatically add properties to the PDFs after they are generated. The PDF will have the same properties as the Word Document that it is generated from.

At first I tried to use Event Receiver but the program doesn't seem to recognize that there's a new item (generated PDF) added into the document library.

Then I tried to use workflow (SharePoint Designer) but it doesn't work either(Failed to Start). The Outcome says "Workflow AddPDFData was canceled by System Account" and "AddPDFData failed to start". The workflow is set to start when an item is created. I know the workflow itself is correct because it works fine when I set it to start when an item is changed.

Please suggest if there's anything that I might do wrong, or if there is any approach that I can use. Any idea/suggestion will be highly appreciated.

Thanks!

Abdul Rahman
  • 2,097
  • 4
  • 28
  • 36
Aoma
  • 11
  • 2

1 Answers1

0

It's a real pain that event receivers don't fire when the document is generated, however, you can definitely use a workflow and 'AutoStartOnCreate'. It works, I have done it. At least it does for Visual Studio 2010 created workflows in SharePoint 2010.

I can't say what the problem is with your workflow, but I suggest that if you add any item to the list the workflow will 'failed on start' for that item, not just the WAS generated items. That error usually means that the workflow can't validate correctly - bad correlation tokens, missing required something etc, you can look elsewhere for more detail.

Paul
  • 544
  • 4
  • 12