none
Adding Outlook Office attachments (e.g. *.doc, *.xlsm) to TRUSTED LOCATION? RRS feed

  • Question

  • First off, this is the environment:

    -Windows 7 Professional

    -Outlook 2010

    -Word 2010

    -VSTO 2010

    I have developed a document-level Word 2010 customization.  When the document is opened from c:\ or any other trusted location, it opens up just fine (as expected).  However, when I attempt to open the same document from Outlook 2010 (when sent as an attachment), I receive the following error:

    Microsoft.VisualStudio.Tools.Applications.Runtime.CannotCreateCustomizationDomainException: This document contains custom code that cannot be loaded because the location is not in your trusted locations list: Test2 (3).doc. If you trust this document you can save and open it from a location on your computer.  For more information, see http://go.microsoft.com/fwlink/?LinkId=99104.

    I know there is a similar thread out there:  http://social.msdn.microsoft.com/Forums/da-DK/vsto/thread/aa945345-c76e-4a5c-91fc-6536855491d6

    But there is no solution posted on that thread.

    My business requirement is:  users shall be able to open the customized document directly from Outlook 2010 when sent as an attachment.  

    Users frequently email documents between themselves, so this is a crucial requirement.

    It's not clear to me from the Microsoft documentation on how to TRUST this Outlook location.  I have read this white paper as well:

    http://msdn.microsoft.com/en-us/library/bb157863.aspx#GrantingTrustToSolutions

    Thank you in advance for your help,


    Khalid K.


    • Edited by Khalid K_ Wednesday, August 15, 2012 3:28 PM
    Wednesday, August 15, 2012 3:27 PM

Answers

  • The only way the customizations would run is if the attachment is saved to the file system. You cannot make an Outlook attachment a trusted location. A certifcate will not do it, it must be saved to a trusted location in the file system.

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "Khalid K_" <=?utf-8?B?S2hhbGlkIEtf?=> wrote in message news:b084552b-b708-4dc 0-96ac-29ea2810d97d...

    Ken,

    Thanks for the response, but the Word document does OPEN just fine in Word when you double click on the word attachment in Outlook.

    However, the real problem is once Word opens the document, the word VSTO customization does not load and you get the error noted above.

    So my question was how do I trust this Outlook location so that when Word opens the document it loads the VSTO customization?  Is the only way to do this by signing the document with a certificate?

    Thank you in advance,


    Khalid K.


    Ken Slovak MVP - Outlook
    Wednesday, August 15, 2012 8:18 PM

All replies

  • By default Outlook will allow you to open DOC and DOCX file attachments directly from the email, the same goes for XLS or XLSX files. If Outlook isn't allowing you to open the files directly, can you open them if they are saved to a trusted location in the file system or to the Outlook secure temp folder?
     
    An Outlook email can never be made a trusted location, as it could come from anywhere or anyone.
     

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "Khalid K_" <=?utf-8?B?S2hhbGlkIEtf?=> wrote in message news:1ecc4630-f928-4097-a98f-8cc8c4d7603f...

    First off, this is the environment:

    -Windows 7 Professional

    -Outlook 2010

    -Word 2010

    -VSTO 2010

    I have developed a document-level Word 2010 customization.  When the document is opened from c:\ or any other trusted location, it opens up just fine (as expected).  However, when I attempt to open the same document from Outlook 2010 (when sent as an attachment), I receive the following error:

    Microsoft.VisualStudio.Tools.Applications.Runtime.CannotCreateCustomizationDomainException: This document contains custom code that cannot be loaded because the location is not in your trusted locations list: Test2 (3).doc. If you trust this document you can save and open it from a location on your computer.  For more information, see http://go.microsoft.com/fwlink/?LinkId=99104.

    I know there is a similar thread out there:  http://social.msdn.microsoft.com/Forums/da-DK/vsto/thread/aa945345-c76e-4a5c-91fc-6536855491d6

    But there is no solution posted on that thread.

    My business requirement is:  users shall be able to open the customized document directly from Outlook 2010 when sent as an attachment.  

    Users frequently email documents between themselves, so this is a crucial requirement.

    It's not clear to me from the Microsoft documentation on how to TRUST this Outlook location.  I have read this white paper as well:

    http://msdn.microsoft.com/en-us/library/bb157863.aspx#GrantingTrustToSolutions

    Thank you in advance for your help,


    Khalid K.



    Ken Slovak MVP - Outlook
    Wednesday, August 15, 2012 6:03 PM
  • Ken,

    Thanks for the response, but the Word document does OPEN just fine in Word when you double click on the word attachment in Outlook.

    However, the real problem is once Word opens the document, the word VSTO customization does not load and you get the error noted above.

    So my question was how do I trust this Outlook location so that when Word opens the document it loads the VSTO customization?  Is the only way to do this by signing the document with a certificate?

    Thank you in advance,


    Khalid K.

    Wednesday, August 15, 2012 7:38 PM
  • The only way the customizations would run is if the attachment is saved to the file system. You cannot make an Outlook attachment a trusted location. A certifcate will not do it, it must be saved to a trusted location in the file system.

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "Khalid K_" <=?utf-8?B?S2hhbGlkIEtf?=> wrote in message news:b084552b-b708-4dc 0-96ac-29ea2810d97d...

    Ken,

    Thanks for the response, but the Word document does OPEN just fine in Word when you double click on the word attachment in Outlook.

    However, the real problem is once Word opens the document, the word VSTO customization does not load and you get the error noted above.

    So my question was how do I trust this Outlook location so that when Word opens the document it loads the VSTO customization?  Is the only way to do this by signing the document with a certificate?

    Thank you in advance,


    Khalid K.


    Ken Slovak MVP - Outlook
    Wednesday, August 15, 2012 8:18 PM
  • ana orid di face

    Thursday, March 14, 2013 6:22 PM
  • You may need to add the following location to the trusted locations in WORD.  Items opened in outlook will be temporarily stored here. 

    C:\Users\%USERNAME%\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.Outlook

    1. Click on FILE > OPTIONS > TRUST CENTER > TRUST CENTER SETTINGS > TRUSTED LOCATIONS

    • Edited by Lovach Friday, March 7, 2014 2:59 PM
    Friday, March 7, 2014 2:52 PM