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

i am confused about deploying my add-in, please help?

$
0
0

hi,

i'm using VS 2013 Community, i also installed Office Development tool to create an add-in.

now, i'm finished with my add-in and want to deploy it on my website so that my colleagues can download it.

there is no Setup Wizard/Deployment module in community version.

would publishin it in release mode work? will the people be able to use it this way?

so what should i do now? and how will other people install the add-in?

could anyone please help?


Dig your well before you are thirsty


How to set hide ActionsPaneControl after saving a document?

$
0
0

I am able (thanks to Cindy Meister) to save my edited document through button handlers located fromActionsPaneControl using code:

Globals.ThisDocument.SaveAs(ref objectName, .....);


But what I cannot figure out is how I  can hide ActonsPaneControl if the current document saved. That is, abutton is clicked to save the  document. 
What I want is not to show ActionsPaneControl when the document will be opened the next times if user saves this document.


How to disable an Outlook 2007 add-on that is preventing Outlook2007 from Opening???

$
0
0
I enabled a disabled Addon via the Trust Center and now Outlook 2007 generate a Program error and is unable to open.  How to I disable it?

Adding Attachments stripping some headers

$
0
0

Hi, 

The scenario goes like this, 

Explorer.selectionchange reads a mailitem, if it contains a specific header, then it injects some attachments (byValue) to it. which are actually empty files (actual file on server, its size is bigger than outlook's limitation), i'm using them for presentation purposes.  

this seems to work fine in outlook 2013 and 2016. however in 2010 its injecting the attachments, sometimes it strips the headers straightly and show (4K) as the size of the attachment. and sometimes it does not strip the headers (does not show size beside the attachments file name) until the next time outlook is started.

I'm totally lost with this problem, none of the available solutions online seem to be working !!! 

any ideas ? 

Thanks

Track Insert Row/Column & Delete Row/Column event of ContextMenuCell and ContextMenuRow

$
0
0

Hi,

I want to put my own code at Insertion & deletion of rows/Columns in excel. i had tried various things like

1) to find out event but failed to find something specific.

2) later on i had tried with idMso but for for this commands i am not able to find idMso. 

3) I had tried with void Application_SheetChange(object Sh, Excel.Range Target) to detect same but not sure how to check weather rows is getting inserted or deleted & same for columns.

Any help will be highly appreciated in advance.


BindingRedirect not working as I thought

$
0
0

I know it has to be something stupid...

I have a dll - let's call it foo.dll, which references BAR.DLL - and has for years - an in foo.dll.config we have

 <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="bar" culture="neutral" publicKeyToken="9816a6fb814b0b7d" />
        <bindingRedirect oldVersion="8.0.0.85" newVersion="8.0.0.85" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>

which works fine when BAR.DLL is installed (it is in the GAC).  My problem is now that BAR.DLL is up a 8.0.1.327

When I run the application, I get an error that says that BAR.DLL culture neutral, key.. version 8.0.0.85 is missing

and when I try changing the config to:

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="bar" culture="neutral" publicKeyToken="9816a6fb814b0b7d" />
        <bindingRedirect oldVersion="8.0.0.85" newVersion="8.0.1.327" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>

I get the SAME error.  I have even tried putting foo.dll.config in the framework redirect locations.  Any clue what I'm doing wrong?

How can I get the active document's Left and Top relative to the screen on MS Word?

$
0
0
How can I get the active document's Left and Top relative to the screen on MS Word?

selam alazar simachew

How to read emails from Exchange online in c#.net using Office 365 API


how to highlight above & after text in table using vsto in word document

$
0
0


Hi,

can you please help me.......

I am very new to VSTO but good at .NET 2013. I would like to know - in VSTO for MS Word, 

How can i highlight above & after text of a table in word document. 

I want to check ony by one text above & after in table through next button when click on button they move to next missing text ....that get missing specific default text which is present on above & on after table ,

if any tag missing then highlight current table on the same 

default value(like [[abc]])

test1

test2

test4

test3

default value(like [[pqr]])


test5

test6

test8

test7

default value(like [[pqr]])

default value(like [[abc]])

test5

test6

test8

test7

In form1.cs

when click on next button move to next missing text and highlight table

I want to first check missing text and then highlight table of missing text

please please help me 



How to create Static Controls at runtime in Word?

$
0
0

I already have a working project creating Dynamic Controls at runtime in Word but when there is a lot of Controls it takes a very long time to load the Document so I am looking for a way to create Static Controls instead.

I know it is not supported by Microsoft but it must be possible in some way since Visual Studio can do it. I looked at the code for a Static Control in the Class generated by the Designer and I found the way to create a ListBox and link it back to its ActiveX Wrapper that was saved in the Document but I don’t know how to create the Static ActiveX Wrapper so does anybody know what is the Method to call to create a Static ActiveX Wrapper?

Is it possible to get the full name of the saved document when a Word document loads?

$
0
0

I am developing VSTO application.
Is it possible to get  
the full name of the saved document in this method:

privatevoidThisDocument_Startup(object sender,System.EventArgs e){

string nameOfFile=.....//gets Name of the file. For example, "D:/1.docx"

}

or in constructor of ActionPaneControl:

publicActionPaneControl(){string address=Globals.ThisDocument.Name;}


How can I get name of the document at start of program?

VS2015 "The project cannot be created" error.

$
0
0

Hi all, 

I have a word document which I have been making some macros for our company's needs. 

I'd like to convert it into a VS Project, but I am unable to create any Office Document projects at all. 

If I try to create an Add-In it works, but a Document-level project, be it importing or creating a new Word Document, invariably results in a non-descriptive "the project cannot be created" error. 

The help link only suggests closing and re-opening Visual Studio, and closing all Office Apps, but the error persists. 

Stuff I have tried: 

Attempting to create the document-level project after a fresh system restart. 

  • Importing the old document (.docx and .docm)
  • Creating a new document (.docx and .docm)

After Repairing the installation of Visual Studio.

After Repairing the installation of MS Office as well.

Notable facts: I have an Office 2016 365 E3 subscription.

VS 2015 Professional is a subscription as well.


The help link does not really address other cases, I don't know any other possible steps to debug it. Any ideas?

Date format problem Listobject Query table

$
0
0

Hi ,

I have created an Add-in in excel to create list object query table dynamically. It works well but date is being displayed as a decimal number - 42342.7879824074 instead of 12/4/2015  6:54:42 PM. What am I doing wrong ? Same query works fine if I create a query table instead of Listobject.Querytable

Here is the code:

listObjects = dataSheet.ListObjects;

                    listObject = listObjects.AddEx(Excel.

XlListObjectSourceType.xlSrcQuery,

                        strConnString,

Type.Missing,

                        Excel.

XlYesNoGuess.xlYes, insertRange,Type.Missing);

                    queryTable = listObject.QueryTable;

                    queryTable.CommandType = Excel.

XlCmdType.xlCmdDefault;

                    queryTable.CommandText = sql;

                    queryTable.AdjustColumnWidth =

true;

                    queryTable.RefreshStyle = Excel.

XlCellInsertionMode.xlInsertEntireRows;

                    queryTable.Refresh();

Any help appreciated.

Arun

Signing a VSTO 2010 Excel Add-in, targeting .NET Framework 4.0, using a SHA-2 certificate

$
0
0

Hi,

I have a VSTO 2010 Excel add-in, targeting .Net Framework 4.0, Visual Studio 2010. 

We were using a SHA-1 certificate for the past few years for signing the manifest and the assemblies. The application has been deployed for a lot of end-users. Now with the SHA-1 deprecation policy coming into effect from January 2016, the renewed certificate that has been issued by the CA is keyed using SHA-256. 


In Visual Studio 2010, when I update the certificate and try to rebuild the project, contents of the generated .VSTO file looks like this:

<assemblyIdentity name="ExcelAddIn1.vsto" version="1.0.0.1" publicKeyToken="2142698160a31911" language="neutral" processorArchitecture="msil" xmlns="urn:schemas-microsoft-com:asm.v1" /><description asmv2:publisher="My Company" asmv2:product="ExcelAddIn1" xmlns="urn:schemas-microsoft-com:asm.v1" /><deployment install="false" /><compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2"><framework targetVersion="4.0" profile="Client" supportedRuntime="4.0.30319" /><framework targetVersion="4.0" profile="Full" supportedRuntime="4.0.30319" /></compatibleFrameworks><dependency><dependentAssembly dependencyType="install" codebase="ExcelAddIn1.dll.manifest" size="18274"><assemblyIdentity name="ExcelAddIn1.dll" version="1.0.0.1" publicKeyToken="2142698160a31911" language="neutral" processorArchitecture="msil" type="win32" /><hash><dsig:Transforms><dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" /></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><dsig:DigestValue>DIGEST VALUE</dsig:DigestValue></hash></dependentAssembly></dependency><publisherIdentity name="CN=, OU=, O=My Company, L=, S=, C=" issuerKeyHash="ISSUER HASH" /><Signature Id="StrongNameSignature" xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha256" /><Reference URI=""><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /><Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" /><DigestValue>DIGEST VALUE</DigestValue>

Note that the DigestMethod for dependentAssembly is SHA1, where as the DigestMethod for publisherIdentity is SHA256. ExcelAddin1.dll.manifest also follows this pattern.


On rebuilding the project in Visual Studio 2015, still targeting .NET framework 4.0, SHA1 is used as the DigestMethod everywhere in the .VSTO and .MANIFEST files.

On updating the project to target .Net Framework 4.5.2 and building it, SHA256 is used throughout these files.

I am able to work with both these build on a machine having Windows 7 SP1, Excel 2010 SP1, .Net Framework 4.5.2 and VSTO 4 Runtime 10.0.60724

Q1. How does the SHA-1 deprecation policy affect VSTO add-ins?

Q2. Can I continue to use SHA-1 certificates for VSTO add-ins even after January 2016?

Q3. Do I have to upgrade the .Net Framework version to be fully compliant about SHA-2 signing?

Q4. What should be the timestamp URL while using SHA-2 certificates? mage.exe shipped with SDK for .NET 4.0 does not have an option to specify the DigestAlgorithm and , however mage.exe that come along SDK for .Net Framework 4.5.2 does have this option -Algorithm<sha256RSA|sha1RSA>    -a.

Thank you.


Regards,
CS

Import Teensy data into Excel

$
0
0
Can I import data from Teensy registers into an Excel spreadsheet?

Outlook Addin does not work outside dev machine

$
0
0
Hello, I hope folks here can help. I have a VSTO addin that works fine in 32-bit Outlook. However if I install 64-bit Outlook, it fails to load. It runs fine and loads if I debug on my dev machine in 64-bit outlook. The addin has 2 dependency dlls and I did not make any change to those dlls for 64-bit. The searches suggested that the .net dlls will be fine in 64-bit. These two dlls appear at the very end of the error log below, in case someone is interested in knowing which dlls are those and and what version etc. The add-in build settings were also left at "any cpu". Here is what I see come up when alerts are not suppressed - Object reference not set to an instance of an object. ************** Exception Text ************** System.NullReferenceException: Object reference not set to an instance of an object. at MyAddIn.ThisAddIn.CreateRibbonExtensibilityObject() at Microsoft.Office.Tools.AddInImpl.get_RibbonExtensibility() at Microsoft.Office.Tools.AddInImpl.Initialize() at MyAddIn.ThisAddIn.Initialize() at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.ExecuteCustomization.ExecutePhase(ExecutionPhases executionPhases) at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.ExecuteCustomization.Microsoft.VisualStudio.Tools.Office.Runtime.Interop.IExecuteCustomization2.LoadEntryPoints(IntPtr serviceProvider) ************** Loaded Assemblies ************** mscorlib Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR 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.40820.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.0.30319.34209 built by: FX452RTMGDR 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.0.30319.34238 built by: FX452RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll ---------------------------------------- System.Configuration Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll ---------------------------------------- System.Xml Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.34234 built by: FX452RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll ---------------------------------------- Microsoft.VisualStudio.Tools.Applications.Hosting Assembly Version: 10.0.0.0 Win32 Version: 10.0.40820.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.Runtime Assembly Version: 10.0.0.0 Win32 Version: 10.0.40820.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 ---------------------------------------- System.Deployment Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.34280 built by: FX452RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Deployment/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Deployment.dll ---------------------------------------- System.Security Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.34252 built by: FX452RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Security/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Security.dll ---------------------------------------- Microsoft.VisualStudio.Tools.Applications.ServerDocument Assembly Version: 10.0.0.0 Win32 Version: 10.0.40820.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 ---------------------------------------- System.Windows.Forms Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.34251 built by: FX452RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll ---------------------------------------- System.Drawing Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.34270 built by: FX452RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll ---------------------------------------- System.Xml.Linq Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml.Linq/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.Linq.dll ---------------------------------------- Microsoft.Office.Tools Assembly Version: 10.0.0.0 Win32 Version: 10.0.40820.0 CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.Office.Tools/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.Office.Tools.dll ---------------------------------------- Microsoft.Office.Tools.Outlook.Implementation Assembly Version: 10.0.0.0 Win32 Version: 10.0.40820.0 CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.Office.Tools.Outlook.Implementation/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.Office.Tools.Outlook.Implementation.dll ---------------------------------------- Microsoft.Office.Tools.Common.Implementation Assembly Version: 10.0.0.0 Win32 Version: 10.0.40820.0 CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.Office.Tools.Common.Implementation/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.Office.Tools.Common.Implementation.dll ---------------------------------------- Microsoft.Office.Tools.Common Assembly Version: 10.0.0.0 Win32 Version: 10.0.40820.0 CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.Office.Tools.Common/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.Office.Tools.Common.dll ---------------------------------------- Microsoft.Office.Tools.Outlook Assembly Version: 10.0.0.0 Win32 Version: 10.0.40820.0 CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.Office.Tools.Outlook/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.Office.Tools.Outlook.dll ---------------------------------------- MyAddIn Assembly Version: 1.4.0.51221 Win32 Version: 1.4.0.51221 CodeBase: file:///C:/Program%20Files/MyAddIn/Outlook/MyAddIn.DLL ---------------------------------------- Microsoft.Office.Tools.Outlook.v4.0.Utilities Assembly Version: 10.0.0.0 Win32 Version: 10.0.30319.1 CodeBase: file:///C:/Program%20Files/MyAddIn/Outlook/Microsoft.Office.Tools.Outlook.v4.0.Utilities.DLL ---------------------------------------- Microsoft.Office.Tools.Common.v4.0.Utilities Assembly Version: 10.0.0.0 Win32 Version: 10.0.30319.1 CodeBase: file:///C:/Program%20Files/MyAddIn/Outlook/Microsoft.Office.Tools.Common.v4.0.Utilities.DLL - Why doesn't this work ? How can I troubleshoot this further ?

Slide export doesn't work for some users

$
0
0

Hello,

I have developed an add-in for MS PowerPoint. One of the features in the add-in allows users to export selected slides in a presentation as individual presentation files.  I have been using Presentation object's _Slide.Export(string FileName, string FilterName) method. While this works for most of the users, for a couple of them, the Export stops immediately after exporting the first slide from the selected slides. For example, if user selects 5 slides and tries to export, only the first slide is exported and the rest aren't. I initially thought that this could be specific to a presentation but found that it was happening irrespective of the presentation I choose and irrespective of the slides I select. I have been banging my head for past few days to no avail and didn't find any issue like this posted anywhere.

Has anyone experienced this? Is there any workaround/fix for this issue?

VSTO runtime EULA

$
0
0
hi,

reading the eula file of the vsto runtime ( the last version ), I read :
"Please note: As this software is distributed in Quebec, Canada, some of the clauses in this agreement are provided below in French."
( "great, I"m French !!" ;-) )

So, this software is not distributed outside of the USA and Canada ? :-)

David

How to get the Data Source of a Chart in Powerpoint

$
0
0

I am trying to get the data Source of a chart added in PowerPoint but cannot find any property to do so.

My Addin takes the data associated with the chart and converts it into some other format to Create Merimekko Chart.

Now,when the user selected only few columns resulting in Column stacked bar graph to have lesser Series (but the underlying data source has data for more series)

So,I want to know what range is actually selected to generate the graph.

So in case of this attached image,I want to find the Column and Row for the Chart data Range. i.e. Row=6 and Column=4


Point5Nyble

VS2008 uninstall causing issues with Office interops

$
0
0

Hi,

We recently upgraded from VS2008 to VS2015. In the process, we upgraded our office interop references to use Office 14 dlls instead of Office 12. We had both VS2008 and VS2015 available on our systems for a while and everything worked fine. After uninstalling VS2008 however, we are running into an issue "An exception of type System.Runtime.InteropServices.COMException occured in xxxx.dll but was not handled in user code. Additional Information: Interface not registered (Exception from HRESULT: 0x80040155)". 

We are getting the same issue in a sample console application as well with the below code:

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            var wd = new Microsoft.Office.Interop.Word.Application();
            System.Diagnostics.Debug.WriteLine(wd.CommandBars.Count);
        }
    }
}


Can anybody please help?

Thank you.

Viewing all 5157 articles
Browse latest View live


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