Quantcast
Channel: Visual Studio Tools for Office (VSTO) forum
Viewing all 5157 articles
Browse latest View live

Outlook ContextMenuContactCardRecipient customizations seem to be unreliable

$
0
0

Menu items added to the Contact card context menu via ContextMenuContactCardRecipient seem to be unreliable. Has anyone else experienced this behaviour?

After opening and closing a few (other) objects in Outlook (i.e opening Inspectors), the icons disappear and the menu items stop responding to all events. They start working again in a new Explorer, but and sometimes when other objects are closed and re-opened. This seems to be reproducible even with a very simple add-in.

The IRibbonUI is being kept in a class-level variable, but not much else. Is there something else which needs to be kept in scope?

I originally thought that the problem seemed to be exacerbated by other add-ins not releasing objects properly, but as it stands I have isolated it down to a very simple add-in running in isolation, with everything else disabled, even most of the Microsoft ones.

Additionally, there does not seem to be any way to force Outlook to invalidate the context-menu items. Even dynamicMenu items with invalidateContentOnDrop set to true seem to be flaky.

Powerpoint addin : How to manage context across multiple open documents ?

$
0
0
I have created a Powerpoint VSTO add-in using C#.

In add-in, I  have created a ribbon (using XML) that provides a Login button.

When a user clicks the login button

 - The login form is displayed
 - The user enters his credentials
 - If credentials are correct, the login button changes color and displays username to denote that the user is logged in
 - Few more ribbon buttons are made visible to allow the user to access data from the server and download it in the ppt.

My issue is :
 

 - I open one ppt document and log in. Ribbon UI is updated
 - If I open a second ppt document, ribbon UI shows that I have already logged in. This is invalid.

How can I contextualize the ribbon state across different presentation documents?

More information and examples regarding Synonym Info object type

$
0
0

Here is an interesting question:

Can anyone provide me some examples of how users access the Synonym Info object type and its methods in Visual Studio IDE?

My purpose is to type in a word in a text box,  click the lookup synonyms command button, and in another text box, display the related synonyms.

Regards,

JohnDBCTX


jp

Misleading piece of information in one of the download pages

$
0
0

I have Windows 10 32bit, Office 2016, VS 2015. I was developing a WinForm application (Front) End as (Microsoft Access 2016), I never found a connection string for the Database I'm using. I stumbled upon this page :

Microsoft Access Database Engine 2016 Redistributable

Where it clearly stated that :

To use this download:
  1.  ........
  2. If you are an application developer using OLEDB, set the Provider argument of the ConnectionString property to “Microsoft.ACE.OLEDB.12.0”

But that never worked for me. Then I've found out programatically that the actual installed provider is :

“Microsoft.ACE.OLEDB.16.0”

Thank you.


VB .Net Help Blog

VB 6.0 Help Blog

General

Use PIAs Excel .dll Office15 without Excel installed in Server

$
0
0

Hi,

We convert Excel file from .xlsx format to .xlsb using a VSTO dll --> Micsosoft.Office.Interop.Excel.dll (Office 15 version) from a C# code server of our Web.

The web works fine in local because in local I have installed Excel, but when I use the published web in the remote server, doesn't works because Excel is not installed. This message appears:

"Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))."

The question: in the remote server is not permitted install Excel, but, Is it possibe only to register the dll o the VSTO components for server, without install Excel app?. In this case, could you explain the process to follow it?. Thanks a lot in advance.

Antonio

Autocomplete and DropdownList shows up both in VSTO Word Ribbon Bar - Form

$
0
0

Hello,

I have a Windows Form in my VSTO Projekt. In a Combobox, I get a List for Autocomplete AND Dropdowitems.

That looks strange - is there a chance to get it programaticly done, to see only one list?

best regards,

Andreas


Andreas Vogt

WIT - new fields

$
0
0

Hello,

I have created a new WIT using an existing work item (export).  The new WIT has new fields added to support the need. The new fields added are displayed as expected via VS Process Template editor preview.  However, after importing to TFS, the new fields are not seen there.  What am I missing?  

Any assistance is greatly appreciated. 

Thanks

Customization does not have the permissions required to create an application domain

$
0
0

When trying to run my excel file on a network drive I am getting this error below.

If I take the folder off the network drive and run it locally it seems to work. It installs the vtso file.

Is there a way to get this to work on a network drive that's on a domain?

************** Exception Text **************
Microsoft.VisualStudio.Tools.Applications.Runtime.CannotCreateCustomizationDomainException: Customization does not have the permissions required to create an application domain. ---> System.Security.SecurityException: Customized functionality in this application will not work because the administrator has listed file://***/ReferenceDataImporter.vsto as untrusted. Contact your administrator for further assistance.
   at Microsoft.VisualStudio.Tools.Office.Runtime.RuntimeUtilities.VerifySolutionUri(Uri uri)
   at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.GetAssemblyDataFromManifests(String solutionLocation, String manifestLocator, String documentName, Boolean showUIDuringDeployment, CustomizationType customizationType, OfficeVersion officeVersion, IHostServiceProvider interopServiceProvider)
   at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.CreateCustomizationDomainInternal(String solutionLocation, String manifestName, String documentName, Boolean showUIDuringDeployment, IntPtr hostServiceProvider, Boolean useFastPath, IntPtr& executor)
   --- End of inner exception stack trace ---


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4180.0 built by: NET48REL1LAST_B
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
Microsoft.VisualStudio.Tools.Office.Runtime
    Assembly Version: 10.0.0.0
    Win32 Version: 10.0.60828.0
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualStudio.Tools.Office.Runtime/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Tools.Office.Runtime.dll
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4180.0 built by: NET48REL1LAST_B
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4001.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
Microsoft.VisualStudio.Tools.Applications.Hosting
    Assembly Version: 10.0.0.0
    Win32 Version: 10.0.60828.0
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualStudio.Tools.Applications.Hosting/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Tools.Applications.Hosting.dll
----------------------------------------
Microsoft.VisualStudio.Tools.Applications.ServerDocument
    Assembly Version: 10.0.0.0
    Win32 Version: 10.0.60828.0
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualStudio.Tools.Applications.ServerDocument/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Tools.Applications.ServerDocument.dll
----------------------------------------
Microsoft.VisualStudio.Tools.Applications.Runtime
    Assembly Version: 10.0.0.0
    Win32 Version: 10.0.60828.0
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualStudio.Tools.Applications.Runtime/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Tools.Applications.Runtime.dll
----------------------------------------


Storing area code data for Add-In

$
0
0

Hi All,

I'm working on an add-in for office in C# and I wanted to store area code data which would be stored with the add-in and then retrieved during runtime.  For example the user could have a list of area codes and the add-in would lookup the codes and return the country/state accordingly.  The Data would have at least 3 columns (Area Code,Country, State)  What would be the best way to store this data, among the options I see are lists or datatables or a database file maybe.  I'm guessing a database file would be slower performance wise so I'm inclined to either use lists or datatables.  Any ideas?

Protect/Hide VBE project code

$
0
0

With Visual Studio 2017, I created one VSTO project.
When user opend project, one function on the (Thisworkbook_OnLoad) import the bas files with the code used from the program.

Right, all was well but, if the user show the vba code, he can see it because it's unprotect.

How I can protect/Hide/Lock the vba code from seeing after importing modules??

If is not possible, any suggestion will be appreciate

Fabrizio

IoC & Dependency Injection in VSTO Add-in

$
0
0

I mainly write VSTO Add-ins for Excel and am starting to adopt Microsoft.Extensions.Configuration to handle json configuration files. At the moment I am creating the configuration in ThisAddIn_Startup() and accessing it via ThisAddIn._config. I was wondering if there is a better way?

So I was wondering about IoC and Dependency Injection usage in VSTO Add-ins, but can't find much directly related to VSTO online.  Does anyone do this for VSTO add-ins and for managing configurations specifically? If so I'd love to see some examples.  The only examples I have found so far all refer to console apps.

I was hoping to use Microsoft.Extensions.DependencyInjection just to avoid depending on external packages as long as it covers my requirements, but any examples will do.

Thanks.

MS Office Add-in error when inheriting a class from DbContext

$
0
0
I’m trying to create a Word VSTO Add-in project in Visual Studio 16.6.1 targeting `.NET Framework 4.8`. I want to use Microsoft.EntityFrameworkCore.Sqlite to access information in a database. However, as soon as I add a class that inherits from `DbContext`, I can no longer build the project. I get an error reporting:

    The "FindRibbons" task failed unexpectedly. 
    System.IO.FileNotFoundException: Could not load file or assembly 'WordAddInTest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

WordAddinTest is the name of my project.

I can reproduce this using these minimal steps:

 1. Create a new Visual Basic project of type Word VSTO Add-in.
 2. Set the name to WordAddinTest, and the Framework to Framework .NET Framework 4.8.
 3. Using the Nuget Package Manager, install `Microsoft.EntityFrameworkCore.Sqlite`.
 4. Replace the default code in ThisAddIn.vb with the following:

Code:

    Imports Microsoft.EntityFrameworkCore
    Public Class ThisAddIn
        Private Sub ThisAddIn_Startup() Handles Me.Startup
        End Sub
        Private Sub ThisAddIn_Shutdown() Handles Me.Shutdown
        End Sub
    End Class
    Public Class TestClass
        Public Property Id As Integer
        Public Property Title As String
    End Class
    Public Class TestContext
        'Inherits DbContext
        'NOTE: If the line above is excluded, it will compile (but obviously without EntityFramework support)
        Public Property TestProperty As DbSet(Of TestClass)
    End Class

This will compile, run and debug without problems.

However, uncommenting the line indicated so that TestContext inherits from DbContext, it no longer compiles, and the Error List displays the following error:

    The "FindRibbons" task failed unexpectedly.
    System.IO.FileNotFoundException: Could not load file or assembly 'WordAddInTest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
    File name: 'WordAddInTest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
    
    Server stack trace: 
       at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
       at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
       at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
       at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)
       at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
       at System.Reflection.Assembly.Load(String assemblyString)
       at System.UnitySerializationHolder.GetRealObject(StreamingContext context)
       at System.Runtime.Serialization.ObjectManager.ResolveObjectReference(ObjectHolder holder)
       at System.Runtime.Serialization.ObjectManager.DoFixups()
       at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
       at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
       at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.DeserializeObject(MemoryStream stm)
       at System.Runtime.Remoting.Messaging.SmuggledMethodReturnMessage.FixupForNewAppDomain()
       at System.Runtime.Remoting.Channels.CrossAppDomainSink.SyncProcessMessage(IMessage reqMsg)
    
    Exception rethrown at [0]: 
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at Microsoft.Build.Framework.ITask.Execute()
       at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
       at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
    
    WRN: Assembly binding logging is turned OFF.
    To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
    Note: There is some performance penalty associated with assembly bind failure logging.
    To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].WordAddInTest

Noting the advice at the end about Fusion Logging, if I set that registry value it adds the following information:

   === Pre-bind state information ===
    LOG: DisplayName = WordAddInTest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
     (Fully-specified)
    LOG: Appbase = file:///C:/applications/programming/Visual Studio 2019 Community/MSBuild/Current/Bin/
    LOG: Initial PrivatePath = NULL
    Calling assembly : (Unknown).
    ===
    LOG: This bind starts in default load context.
    LOG: Using application configuration file: C:\applications\programming\Visual Studio 2019 Community\MSBuild\Current\Bin\MSBuild.exe.Config
    LOG: Using host configuration file: 
    LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
    LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
    LOG: Attempting download of new URL file:///C:/applications/programming/Visual Studio 2019 Community/MSBuild/Current/Bin/WordAddInTest.DLL.
    LOG: Attempting download of new URL file:///C:/applications/programming/Visual Studio 2019 Community/MSBuild/Current/Bin/WordAddInTest/WordAddInTest.DLL.
    LOG: Attempting download of new URL file:///C:/applications/programming/Visual Studio 2019 Community/MSBuild/Current/Bin/WordAddInTest.EXE.
    LOG: Attempting download of new URL file:///C:/applications/programming/Visual Studio 2019 Community/MSBuild/Current/Bin/WordAddInTest/WordAddInTest.EXE.WordAddInTest

Visual Studio is looking for my Add-in DLL in the MSBuild directory.

Is it just not possible to use Entity Framework in a VSTO Add-in project?
Is there another logical explanation for why it can’t compile?
I haven’t been able to find any other reports of the same problem, and I can’t imagine I’m the first person to try it.

I realize there is more required to actually use the EntityFramework to access a database, but this is a compilation error, so it isn’t even getting that far.

Thank you for any help that can be provided.

Following is `.vbproj` (equivalent of .csproj) file in case it can shed some light on identifying/solving the issue:

 
<Project ToolsVersion="16.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"><Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /><!--
        This section defines project-level properties.
        AssemblyName
          Name of the output assembly.
        Configuration
          Specifies a default value for debug.
        OutputType
          Must be "Library" for VSTO.
        Platform
          Specifies what CPU the output of this project can run on.
        NoStandardLibraries
          Set to "false" for VSTO.
        RootNamespace
          In C#, this specifies the namespace given to new files. In VB, all objects are
          wrapped in this namespace at runtime.
      --><PropertyGroup><ProjectTypeGuids>{BAA0C2D2-18E2-41B9-852F-F413020CAA33};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids><Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration><Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform><ProjectGuid>{A4902970-1F65-45A0-AED0-5B3398DFE0CD}</ProjectGuid><OutputType>Library</OutputType><NoStandardLibraries>false</NoStandardLibraries><RootNamespace>WordAddinTest</RootNamespace><AssemblyName>WordAddinTest</AssemblyName><LoadBehavior>3</LoadBehavior><TargetFrameworkVersion>v4.8</TargetFrameworkVersion><DefineConstants>VSTO40</DefineConstants><BootstrapperEnabled>true</BootstrapperEnabled><BootstrapperComponentsLocation>HomeSite</BootstrapperComponentsLocation></PropertyGroup><ItemGroup><BootstrapperPackage Include="Microsoft.VSTORuntime.4.0"><Visible>False</Visible><ProductName>Microsoft Visual Studio 2010 Tools for Office Runtime %28x86 and x64%29</ProductName><Install>true</Install></BootstrapperPackage></ItemGroup><PropertyGroup><!--
          OfficeApplication
            Add-in host application
        --><OfficeApplication>Word</OfficeApplication></PropertyGroup><!--
        This section defines properties that are set when the "Debug" configuration is selected.
        DebugSymbols
          If "true", create symbols (.pdb). If "false", do not create symbols.
        DefineConstants
          Constants defined for the preprocessor.
        EnableUnmanagedDebugging
          If "true", starting the debugger will attach both managed and unmanaged debuggers.
        Optimize
          If "true", optimize the build output. If "false", do not optimize.
        OutputPath
          Output path of project relative to the project file.
        WarningLevel
          Warning level for the compiler.
      --><PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "><DebugSymbols>true</DebugSymbols><DebugType>full</DebugType><Optimize>false</Optimize><OutputPath>bin\Debug\</OutputPath><EnableUnmanagedDebugging>false</EnableUnmanagedDebugging><DefineConstants>$(DefineConstants);DEBUG;TRACE</DefineConstants><WarningLevel>4</WarningLevel></PropertyGroup><!--
        This section defines properties that are set when the "Release" configuration is selected.
        DebugSymbols
          If "true", create symbols (.pdb). If "false", do not create symbols.
        DefineConstants
          Constants defined for the preprocessor.
        EnableUnmanagedDebugging
          If "true", starting the debugger will attach both managed and unmanaged debuggers.
        Optimize
          If "true", optimize the build output. If "false", do not optimize.
        OutputPath
          Output path of project relative to the project file.
        WarningLevel
          Warning level for the compiler.
      --><PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "><DebugType>pdbonly</DebugType><Optimize>true</Optimize><OutputPath>bin\Release\</OutputPath><EnableUnmanagedDebugging>false</EnableUnmanagedDebugging><DefineConstants>$(DefineConstants);TRACE</DefineConstants><WarningLevel>4</WarningLevel></PropertyGroup><!--
        This section specifies references for the project.
      --><ItemGroup><Reference Include="Accessibility" /><Reference Include="System" /><Reference Include="System.Data" /><Reference Include="System.Drawing" /><Reference Include="System.Windows.Forms" /><Reference Include="System.Xml" /><Reference Include="System.Core" /><Reference Include="System.Xml.Linq" /><Reference Include="System.Data.DataSetExtensions" /><Reference Include="Microsoft.CSharp" /></ItemGroup><ItemGroup><Reference Include="Microsoft.Office.Tools.v4.0.Framework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"><Private>False</Private></Reference><Reference Include="Microsoft.VisualStudio.Tools.Applications.Runtime, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"><Private>False</Private></Reference><Reference Include="Microsoft.Office.Tools, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"><Private>False</Private></Reference><Reference Include="Microsoft.Office.Tools.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"><Private>False</Private></Reference><Reference Include="Microsoft.Office.Tools.Word, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"><Private>False</Private></Reference></ItemGroup><ItemGroup><Reference Include="Microsoft.Office.Tools.Common.v4.0.Utilities, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"><Private>True</Private></Reference></ItemGroup><ItemGroup><Reference Include="Office, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"><Private>False</Private><EmbedInteropTypes>true</EmbedInteropTypes></Reference><Reference Include="Microsoft.Office.Interop.Word, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"><Private>False</Private><EmbedInteropTypes>true</EmbedInteropTypes></Reference><Reference Include="stdole, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"><Private>False</Private></Reference></ItemGroup><!--
        This section defines the user source files that are part of the project.
        A "Compile" element specifies a source file to compile.
        An "EmbeddedResource" element specifies an .resx file for embedded resources.
        A "None" element specifies a file that is not to be passed to the compiler (for instance, 
        a text file or XML file).
        The "AppDesigner" element specifies the directory where the application properties files
        can be found.
      --><ItemGroup><Compile Include="Model.cs" /><Compile Include="Properties\AssemblyInfo.cs"><SubType>Code</SubType></Compile><EmbeddedResource Include="Properties\Resources.resx"><Generator>ResXFileCodeGenerator</Generator><LastGenOutput>Resources.Designer.cs</LastGenOutput><SubType>Designer</SubType></EmbeddedResource><Compile Include="Properties\Resources.Designer.cs"><AutoGen>True</AutoGen><DependentUpon>Resources.resx</DependentUpon></Compile><None Include="WordAddinTest_TemporaryKey.pfx" /><None Include="Properties\Settings.settings"><Generator>SettingsSingleFileGenerator</Generator><LastGenOutput>Settings.Designer.cs</LastGenOutput></None><Compile Include="Properties\Settings.Designer.cs"><AutoGen>True</AutoGen><DependentUpon>Settings.settings</DependentUpon></Compile><Compile Include="Ribbon1.cs" /><Compile Include="ThisAddIn.cs"><SubType>Code</SubType></Compile><None Include="ThisAddIn.Designer.xml"><DependentUpon>ThisAddIn.cs</DependentUpon></None><Compile Include="ThisAddIn.Designer.cs"><DependentUpon>ThisAddIn.Designer.xml</DependentUpon></Compile><AppDesigner Include="Properties\" /></ItemGroup><ItemGroup><EmbeddedResource Include="Ribbon1.xml" /></ItemGroup><ItemGroup><PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite"><Version>3.1.4</Version></PackageReference><PackageReference Include="Microsoft.EntityFrameworkCore.Tools"><Version>3.1.4</Version><IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets><PrivateAssets>all</PrivateAssets></PackageReference></ItemGroup><PropertyGroup><VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion><VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath></PropertyGroup><PropertyGroup><SignManifests>true</SignManifests></PropertyGroup><PropertyGroup><ManifestKeyFile>WordAddinTest_TemporaryKey.pfx</ManifestKeyFile></PropertyGroup><PropertyGroup><ManifestCertificateThumbprint>002EE54C6C297029AF8A7691A5DAC8F51DACA96A</ManifestCertificateThumbprint></PropertyGroup><!-- Include the build rules for a C# project. --><Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /><!-- Include additional build rules for an Office application add-in. --><Import Project="$(VSToolsPath)\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets" Condition="'$(VSToolsPath)' != ''" /><!-- This section defines VSTO properties that describe the host-changeable project properties. --><ProjectExtensions><VisualStudio><FlavorProperties GUID="{BAA0C2D2-18E2-41B9-852F-F413020CAA33}"><ProjectProperties HostName="Word" HostPackage="{29A7B9D7-A7F1-4328-8EF0-6B2D1A56B2C1}" OfficeVersion="15.0" VstxVersion="4.0" ApplicationType="Word" Language="cs" TemplatesPath="" DebugInfoExeName="#Software\Microsoft\Office\16.0\Word\InstallRoot\Path#WINWORD.EXE" DebugInfoCommandLine="/x" AddItemTemplatesGuid="{51063C3A-E220-4D12-8922-BDA915ACD783}" /><Host Name="Word" GeneratedCodeNamespace="WordAddinTest" IconIndex="0"><HostItem Name="ThisAddIn" Code="ThisAddIn.cs" CanonicalName="AddIn" CanActivate="false" IconIndex="1" Blueprint="ThisAddIn.Designer.xml" GeneratedCode="ThisAddIn.Designer.cs" /></Host></FlavorProperties></VisualStudio></ProjectExtensions></Project>



  [1]: https://docs.microsoft.com/en-us/visualstudio/vsto/create-vsto-add-ins-for-office-by-using-visual-studio?view=vs-2019
  [2]: https://www.nuget.org/packages/Microsoft.EntityFrameworkCore.Sqlite/

Certificate for open-source Excel Add-In

$
0
0

Hello!

I am working on my pet-project - common tools for MS Excel. The project is being developed as a VSTO add-in, and is published on GitHub under MIT license:

 https://github.com/navferty/NavfertyExcelAddIn

It includes some useful features like parsing numerics stored as text, stringify numbers into words (english, russian, french languages), searching for all cells that contain formula errors, text transliteration and others.

The project is signed with self-issued sertificate, and this makes installation process very complex for users who want to use this add-in (they need to manually import certificate before install).

Is it possible to have a certificate from trusted CA for this project? What steps must be done?

Office Interop Assemblies

$
0
0

I have a C# .Net application that I originally developed with Visual Studio 2012 that interfaces to PowerPoint.  I've been running it for a long time with VS2012 without any  problems and I recently decided to upgrade to VS2019. 

When I upgraded to VS2019 everything was fine until I uninstaled VS2012.  As soon as I uninstalled VS2012, VS2019 could no longer find the reference "microsoft.office.interop.powerpoint".  I tried everything to install Office PIA's.  and couldn't resolve the problem.  I want to get rid of VS2012 because I no longer need it and it is just taking up disk space unnecessarily but I can't uninstall it until I can figure out how to get VS2019 to recognize the Office Interop Assemblies.

  • I have an Office 365 subscription on my development computer and I saw someone suggested reinstalling Office 365 and selection ".Net Programmability" as part of the installation.  I have reinstalled Office 365 but I don't see any way to tell it to install .Net Programmability as part of the installation. 
  • I also reinstalled the Visual Studio 2010 Tools for Office Runtime and that didn't help.

Can someone please tell me how I can get VS2019 to work with Office interop so that I can get rid of VS2012?

Thanks!


Chuck



MS Word- content control events in track changes ON not working

$
0
0
In my vsto plug-in for word, I am working with content control delete event (ContentControlBeforeDelete). The event is fired when i delete a rich text content control. But when the track changes are ON then on deleting the content control this event is not triggered. Also, if the content control is deleted then ContentControlOnEnter/ContentControlOnExit events are working. Is there any way I can detect when the Content control is deleted by the user with Track change ON for the document.

How can I display Power Point slides in another window?

$
0
0
Hello I am working on a project as part of my studies whose goal is a PowerPoint add-in. I want to improve the Advanced Custom Show. Therefore I would like to display the slide preview in an external window, which is always shown on the right side when creating slides.The only approach I had was to export the slides of the slide collection as an image and then use them.  But I would like to know how Microsoft displays the slides on the right side in PowerPoint? 


Microsoft Office Interop: Cannot apply indexing with [] to an expression of type 'object'

$
0
0

Following code of my Microsoft Office WORD VSTO Add-in, was successfully getting the document title before. But now, it's throwing the error shown below:

string sTitle = oActiveDoc.BuiltInDocumentProperties["Title"].Value; 

Error: Cannot apply indexing with [] to an expression of type 'object'

Based on some similar online solutions (such as this and this) to the issue I tried the following code but I'm still getting the exact same error.

Question: What I may be missing here and how can it be resolved?

**Ref**:  Document.BuiltInDocumentProperties gets a Microsoft.Office.Core.DocumentProperties `collection` that represents all the built-in document properties for the document.

**Following also gives the exact same error**:

string sTitle = oActiveDoc.BuiltInDocumentProperties["Title"].Value as string;
string sTitle = oActiveDoc.BuiltInDocumentProperties["Title"] as string;

Generate Powerpoint Slide images for add-in without performance problems

$
0
0
Hi everyone, I'm trying to make an add-in for PowerPoint. For this I need a slide preview of the PowerPoint slides (just like Powerpoint itself has at the left, with the small preview pictures). The only way I can think of is to use the Export() method to create images of the slides and cache them on the user's hard drive and then use them. However, I don't find this option very nice. I also think that I will run into performance problems with it relatively quickly.
Is there a better way so that I do not have to read/write to the user's hard drive?

And I'm sorry, I'm completely new to VSTO, C# ......
Thank you very much!

Integrating Dynamics CRM 365 online with Word add-in VSTO

$
0
0

I'm developing a solution using VS 2017 with Word VSTO add-in project.

The project is connecting to Dynamics CRM 365 online using SDK.

When authenticating to Dynamics, it got error/exception. The code is working in Windows Form and Console application.

Any ideas?


Benjamin Fallar III

DeploymentException when Debug Outlook addin

$
0
0
Hi there,

After developing an outlook addin using VS2008, i had to format my PC.
I saved the code in a safe place, formated the PC and installed office 2007 - and after that VS2008.

Now when i try to debug my code I get the following exception:

A first chance exception of type 'System.Deployment.Application.DeploymentException' occurred in System.Deployment.dll
Additional information: Store metadata "CurrentBind" is not valid.


This exceptoin is followed by several others and thefore the debug is unpossible. When opening outlook without debug from VS, the the addin is working properly.

Did some one encouter this before?

Thanks,
Amir.

PS - when i open the project in the first time it asked me for the key password. Since i forgot, i replaced the key with a new test key.

Viewing all 5157 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>