Archive for the 'VSTA' Category

04
Feb
10

Establishing a Reference to InfoPath SemiTrust and InfoPath Xml Interop Libraries in VSTA

If you are attempting to use the namespaces

using Microsoft.Office.Core;
using Microsoft.Office.Interop.InfoPath.SemiTrust;
using Microsoft.Office.Interop.InfoPath.Xml;

in your VSTA project, you’ll find that you need to include some references. 

In order to get the Interop references, you may need to download and install Office 2003/2007 Primary Interop Assemblies (PIA) redistributable package.  You also want to make sure you have the .NET Programmability Support and VSTA installed for InfoPath.  You can use Add/Remove Programs in Office 2007 to insure you have .NET Programmability Support/Visual Studio Tools for Applications installed.

Add/Remove Programs showing interop assembly entries

image

Add/Remove features on Office 2007 showing InfoPath section

image

Now you need to add the references.  You’ll find the DLLs you need to reference in \Program Files\Microsoft Office\Office12.  Microsoft.Office.Interop.InfoPath.SemiTrust.dll and Microsoft.Office.Interop.InfoPath.Xml.dll.

.image

You can use the browse feature when adding the reference to find the DLLs.

image

The reference to Microsoft.Office.Core is from either the Microsoft Office 11.0 Object Library (Office 2003) or the Microsoft Office 12.0 Object Library (Office 2007).

image

 Happy automating!




Asif Rehmani’s SharePoint Videos

SharePoint-Videos

Click to access a wealth of SharePoint videos

SharePoint Rx

SharePoint Rx Home

Categories

Posts by Date

December 2019
M T W T F S S
« Jun    
 1
2345678
9101112131415
16171819202122
23242526272829
3031  
Support Wikipedia