locked
ExportAsFixedFormat method not raising an error in document not saved RRS feed

  • Question

  • We have an VBA macro used by an Word 2010 solution which uses the 'ExportAsFixedFormat' method to save a document in PDF format in SharePoint. In the Word 2010 environment, if the Sharepoint folder specified for the file save does not exist, we get an error thrown so we can then handle the problem. However, when we test the same macro using Word 2013, the ExportAsFixedFormat method does not seem to be throwing an error if it cannot save the document. This means we run into problems further down the macro when we try to update the meta data for the document as it does not exist.

    Has the behaviour of this method changed and if so is there any way we can tell whether the document was sucessfully saved or not using this method?

    Many thanks

    Nigel


    Nigel T

    Wednesday, March 13, 2013 10:23 AM

All replies

  • Hi

    I have done a bit more research and I think I have found the problem. In our Office 2013 environment we have the 'Office Upload Center' installed so I think what is happening is:

    VBA Macro calls the 'ExportAsFixedFormat' method which effectively makes a request to the upload centre to upload the file. This will always work and hence no error is returned to the macro. However, because the document is not actually saved in SharePoint because the destination folder does not exist, the attempt to update meta data fails. If I look in the upload centre at this point I can see the document with an error status and I can even open the document as Word reads the cache version in the upload centre.

    What I really want to do is bypass the upload centre and let the user know immediately that there is a problem. I don't want the user to have to sort out any problems with the upload, if they press the 'Save in SharePoint' button I want the document to be saved or an error returned. I don't want the document to be in some half way state.

    Is there any way to do this or alterntively can I get the upload centre to perform an action in SharePoint if it detects a problem?


    Nigel T

    Thursday, March 14, 2013 9:56 AM
  • This is a quick note to let you know that we are doing research on this issue. We will let you know if there is any progress.

    Have a nice day.

    Yoyo Jiang[MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, March 15, 2013 5:37 AM
  • Hi

    Thanks for the update and for looking into the problem. One of the reasons we need to guarantee that the document is physically stored in SharePoint and not in a error state in the Upload center is because we send an E-Mail to the receipient of the letter as soon as the Word macro completes. Some users look at the document immediately, so we need to guarentee that the document has been saved before sending the E-Mail. Also the save is effectively a two stage process:

    1. Save the document (creating the destination folder if necessary).
    2. Update the SharePoint meta data associated with the document.

    Step 2 will not work if step 1 fails so again we cannot have the document stuck in the upload center. We either need the upload center to automatically create the folder and set the meta data (ie intercept all requests to update SharePoint not just the document save) or raise an error in the macro if the document save request fails so we can take the appropriate action.

    Thanks

    Nigel


    Nigel T

    Friday, March 15, 2013 9:23 AM
  • Hi

    Any update on your investigations into this. The users of the word macro where we found this problem are very concerned that the use of the upload centre may not guarentee that a document is physically stored in SharePoint and I need to be able to reassure them or find a woprkaround to this problem.

    Thanks

    Nigel


    Nigel T

    Wednesday, March 20, 2013 10:26 AM
  • Hello Nigel T,

    I have spent some time trying to find a way to bypass the Office Upload Center but have not been able to find a way to do that. 

    If you need to find a way to do this but, don't get an answer from the forum you might consider creating a paid support incident which can provide a more in-depth level of support.  Please visit the below link to see the various paid support options that are available to better meet your needs:

      http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone


    Thank you, Matt B. Microsoft Online Community Support

    Sunday, April 21, 2013 9:57 PM