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

After Office 2016 update to 16.0.10730.20088 version VSTO not working

$
0
0

Hello,

I have Excel COM Add-in. This project is created on Visual Studio 2010, Excel 2007, .NET FrameWork 3.5. 

This COM Add-in works with 32-bit Excel versions: 2007/2010/2013/2016. Recently my clients updated Excel to latest version(16.0.10730.20088) and it stopped properly working. This happen only with Excel 2016. Clients who are working with latest 2007/2010/2013 Excel version have no problems. Then I downgraded Excel version to: 16.0.10325.20082 it works normal, sadly a lot of clients already have Office 2016 and each started calling because after update project not working.

Adding pictures of different Excel 2016 versions below - to show what is not working, and will try to explain.

In project we have simple empty Form1 and UserForm which has menu, buttons, fields, grid and other stuff you can see in pictures bellow. On ThisAddIn_Startup we are putting UserForm on Form:

myControl = new UserControl1();
frmSarasai = new Form1();
frmSarasai.Controls.Add(myControl);
myControl.Dock = DockStyle.Fill;

So after UPDATE for e.g: Panel, TabPage, and all items inside are blank and grey "like" empty form as you can see. Also Try Catch does not detect any issues and user does not receive any error. I will repeat: users with Excel 2007/2010/2013 working just fine! This is happen only for Excel 2016. The only solution for each user only to downgrade to any version below. 

So I'm writing here, to find out how to fix this without making users back to older Excel versions?


Ribbon designer

$
0
0

I wanted to add a context menu in outlook on right  click on inbox mails i just want to use ribbon designer  not

Xml is there a way for doing ?

Example:

let button name be  thanks

on  clicking button i 'll  get  a reply template mail for thanking the sender.

Macro security warning prompted when my document is created by my add-ins

$
0
0

Hi,

I have a office add-ins which will add/update document properties for `document control`, but I found that "Macro security" warning will prompt on the document I created and updated by the add-ins under Office 2013.  And I tried that if my"Macro security" setting changed to "Disable all macros except digitally signed macros", the prompt will not shown when I open the file.

My add-in is just updating document properties, Word and Excel will prompt this warning but PowerPoint hasn't when "Macro security" under "Disable all macros with notification", so may I have any hints that how office determine the file is need to prompt or not?

Thanks.


calendarw

Zip gets corrupt after attaching and sending via vsto in online mode (VSTO, Office 2016, Exchange 2016, C#)

$
0
0

Hi,

we have an vsto addin which, with a click on a button, saves the attachments, zip them and reattaches the zip to the mail. After this it sends the mail with MailItem.Send();

This used to work fine but we have a strange issue with one of our customers.

He uses Office 2016 on Terminal Server with online mode and has an Exchange 2016.

If he sends e.g. 3 times the same mail with the addin one of these mails has just an empty zip attached without any files in it.

We debugged the process and the zip is correctly attached in the mail (all files show up and you can open the files in the zip) before sending with MailItem.Send().

After sending the mail the zip has only 4kb and has no files in it (mail in sent items and also the received mail). If I download the zip to the desktop the size on disk is zero.


This only happens in online mode not in cached mode.

If you open the zip manually before sending, the zip does not get corrupted after sending.

This also happens if we do not use mailitem.send() but the customer sends manually after the zip is attached by the addin.

It seems that in online mode the exchange server is aware of the zip but fails to upload the zip to the mail and only sends an empty container. The strange thing is that it works sometimes and sometimes not.

In the code we release all outlook objects with marshal.releasecomobject.

At the moment I really don't know what this could be. For sure it has to do something with the customers infrastructure because with other customers the problem never occurred.

Does anyone have any idea what this could be, any similar experience or idea where to look (logs etc.)?

Thank you very much

Mark


Regards Mark





2003 excel document-level project to latest 2013 excel version.

$
0
0

Hi,

I have to deal with a very old excel 2003 targeted document-level project (developed using VS2005) migration to excel 2013 using VS2015.

Challenges I have are

1) I cannot load the project in VS2015 because the excel project templates are not available.

2)I cannot simply use the latest VSTO runtime to be able to load the old document-level customized excel.

If I create a new excel project in vs2015 targeting 2013 office system, can I make the changes to output xlsx file to load the same customization dll's that my old excel add-in was trying to load?

Any help would be appreciated.

Thanks,

Aravind K

SharePoint add-ins don't work on visual studio 2017

$
0
0

Hello,

I am trying to use vs 2017 pro with SharePoint add ins.

However when i try to create SharePoint project or connecting SharePoint explorer to a SharePoint online site, i have an error message that indicate: SharePoint foundation or SharePoint server is missing.

Could you please indicate why i have this message `?

Do I install SharePoint server in my machine?


VISTO Outlook Add-In Auto Format Rule Filter Not Working

$
0
0

I have the code below that is suppose to create a rule and use the filter but its not The Settings are changing but the filter is not being applied. Also the View is changing the Table columns when applied.

        var rule = caseView.AutoFormatRules.Add("ProjectFilteringRule_" + Prj.Id.ToString());
            string MsgGuid = ServiceConnector.GetMessagesGuid();
            //0d6616a3-2e7d-74e4-be6e-52f7a788989d
            rule.Filter = "=\"http://schemas.microsoft.com/mapi/string/{" + MsgGuid + "}/ProjectFilteringTag\" LIKE \"%{" + Prj.Id.ToString() + "}%\"";
            if (Prj != null) {
                if (Prj.OutlookSettings != null) {
                    if (Prj.OutlookSettings.FontWeight.Equals("bold")) {
                        rule.Font.Bold = true;
                    }
                    if (Prj.OutlookSettings.FontStyle.Equals("italic")) {
                        rule.Font.Italic = true;
                    }
                    if (Prj.OutlookSettings.FontSize > 0) {
                        if (Prj.OutlookSettings.FontSize < 17) {
                            rule.Font.Size = 18;// Prj.OutlookSettings.FontSize;
                        } else {
                            rule.Font.Size = 18;
                        }
                    }
                    if (Prj.OutlookSettings.FontColor != null) {
                        rule.Font.Color = OlColor.olColorRed;
                        //rule.Font.Color = (OlColor)ColorTranslator.ToWin32(Color.FromArgb(Prj.OutlookSettings.FontColor.r, Prj.OutlookSettings.FontColor.g, Prj.OutlookSettings.FontColor.b));
                    }
                }
            }
            rule.Enabled = true;
            caseView.Save();
            caseView.Apply();

Setting CultureInfo

$
0
0

Hi,

I am working on a VSTO that will be multilingual.

But when I run it my CustomRibbon still shows in the default language.

In ThisAddin_Startup I have this code:

wb = this.Application;
            int lcid = wb.LanguageSettings.get_LanguageID(Office.MsoAppLanguageID.msoLanguageIDUI);
            Thread.CurrentThread.CurrentCulture = new CultureInfo(lcid);

The CustomRibbon Localizable property is set to true
And it has two resx files, the default and CustomRibbon.sv.resx

But when I change language to Swedish in MS Word it still shows labels in English that are the default language. (lcid returns 1053 correctly for Swedish)

What do I need more? I must be missing something.

Regards,
Phrone

// edit

i'm using office 2013 and Visual Studio 2017


How to display a UWP form in MS Office VSTO app?

$
0
0

As explain here in an official MSDN tutorial I can display a winform form in a VSTO project.

  1. How can we display a UWP form in a VSTO appt?
  2. I heard Microsoft's desktop to app to a UWP utility does not work for VSTO apps. Is that still true?

Static code analyzer for VBA scripts

$
0
0

Hi Team

Could you please recommend the best way to analyze a VBA code for security threats? What is the best static code analyzer available for VBA scripts? I would like to have something from Microsoft or something recommended by Microsoft. 

Regards

Ragesh 

C# - Microsoft Word VSTO - Update ProgressBar in Form

$
0
0

I have posted the same questions to StackOverflow and didn't get any response. Hopefully I can get some help here.https://stackoverflow.com/questions/52393138/c-sharp-microsoft-word-vsto-update-progressbar-in-form

I am trying to update the ProgressBar for while doing some lengthy document manipulation in a Form invoked from the Ribbon button click event. But I was getting exception "Cross-thread operation not valid: Control 'progressBar1' accessed from a thread other than the thread it was created on."

The Form works as expected when invoked from a standalone application. Below is a mark up of a sample Form

publicpartialclassForm1:Form{publicForm1(){InitializeComponent();}private async voidTest_Click(object sender,EventArgs e){
        progressBar.Minimum=0;
        progressBar.Maximum=100;
        progressBar.Step=1;var progressHandler =newProgress<int>(value =>{//throw the error: "Cross-thread operation not valid: Control 'progressBar' accessed from a thread other than the thread it was created on."
            progressBar.Value= value;});var progress = progressHandler asIProgress<int>;
        await Task.Run(()=>{for(int i =0; i !=100;++i){if(progress !=null)
                    progress.Report(i);Thread.Sleep(100);}});
        progressBar.Value= progressBar.Maximum;}}

It works fine when called from a standalone app.

staticvoidMain(){Application.EnableVisualStyles();Application.SetCompatibleTextRenderingDefault(false);Application.Run(newForm1());}

But I am getting the exception "Cross-thread operation not valid: Control 'progressBar1' accessed from a thread other than the thread it was created on." when I called it from the Ribbon button click event though. See the code below.

privatevoid btnRibbon_Click(object sender,RibbonControlEventArgs e){var bf =newForm1();
        bf.Show();}

Have been playing with it for a couple days now and couldn't figure what the problem was.

Thanks, Brian


tofuTnT

Installation error

$
0
0

When I hand the binaries to another computer I can not install...

Customized functionality in this application will not work because the certificate used to sign the development manifest for "" or its location is not trusted. Contact your administrator for further assistance.

VSTO Add-In will not load on Startup

$
0
0
We are running 32-Bit Office (Outlook 2016) on 64-Bit Windows (Win10)

The Add-In shows up on the Inactive List.  It's not on the Disabled Add-ins list.

When I bring up the COM Add-Ins Dialog, the Add-in is unchecked and it's Load Behavior is "Unloaded".

However, the LoadBehavior value in the registry is 3.

The Add-In will load after placing a check in the box next to it's entry in the "COM Add-ins" dialog, but when you restart Outlook it is back to its unloaded state and theLoadBehavior registry value is still 3.

Any ideas?


Germán Hayles

VISTO Outlook Add-In Create Auto Format Rule

$
0
0

So using the rulel.filter works wih a contact field but not with anything else if i try to including this: 

rule.Filter = "\"urn:schemas-microsoft-com:office:office#Keywords\" LIKE '%Test{[1]}%'";

I have heard of a issue that someone put out that its a but but it works one way but not the other does not make sense.

this is filtering on the Categories section i am pulling the rule from the system after creating it via outlook.

this is the error i get: 

{System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: Value does not fall within the expected range.
   --- End of inner exception stack trace ---
   at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)
   at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
   at System.Dynamic.IDispatchComObject.GetMembers(IEnumerable`1 names)}

Form Region not deployed

$
0
0

I'm having a problem with a Outlook Addin deployment.

The Addin is working fine on my development machine (debug and installed version) but when I'm installing it on another computer the addin is loading and running but the region form is not showing (only the title frame is showing, not the content).

I'm using VS 2017 and Outlook 2016 32bits. 

I have made a setup file from Wix.

I'm creating the following registry entries:

HKCU

Software\Microsoft\Office\Outlook\Addins\CASLAddin

Description

FriendlyName

LoadBehavior

Manifest

and

HKCU

Software\Microsoft\Office\Outlook\FormRegions\IPM.Note

CASLAddin.CASLFormRegion

.vsto and dll.manifest files are deployed on the PC.

Do I need to sign the Assembly?

I'm out of solutions...


visio and visual studio

$
0
0

Hi,

I created an application using VB.net. I don't have any issues until I included MS Visio on the reporting part. I now get an error during the installation of my application. Are there issues on including MS Visio? If there is any, how can I resolve this?

Thanks,

Gilbert

Is there any limit in Excel Named range RefersTo ?

$
0
0

Hi

I am now writing a c# Excel AddIn Code using Interop.

I want to make a button to add the selected cells to the existing range.

Below code works fine, but when it exceeds certain number of cells, it produces an error.

But when I try to add cells in the Excel using Name manger, I could add it. 

I assum there is a limit in the length "RefersTo" in the code? Does anybody know anything about this?? And any other alternative way I can add exceeding the limit?

My code is as below:

                //If marked range already exists, add the current selection address to it
                for (var i = 1; i <= curWorkbook.Names.Count; i++)
                {
                    if (curWorkbook.Names.Item(i, Type.Missing, Type.Missing).Name == ("ADS_Mark" + markNum.ToString()))
                    {
                        String[] eachRange = curWorkbook.Names.Item(i, Type.Missing, Type.Missing).RefersTo.Split(',');

                            curWorkbook.Names.Item(i, Type.Missing, Type.Missing).RefersTo += ("," + mark1Address);

                            //Change the color of selected range
                            curRange.Interior.ColorIndex = markColorIndex;
                            return;

                    }
                }

                           

how to programatically set the path for browse button on reuse slide pane and open file open dialog for given path, for reusing slide in Powerpoint c#

$
0
0

hello,

i am working on VSTO -  powerpoint 2016. i am able to open the reuse slide pane pragmatically by 

Microsoft.Office.Interop.PowerPoint.Application ppApp = Globals.ThisAddIn.Application;

ppApp.CommandBars.ExecuteMso("SlidesReuseSlides");

this code of lines. but now i need to set the path to file open dialog of browse button of reuse slide pane. (i think it open file open dialog ref with reuse slide pane) so, when browse button get clicked then given path destination folder will get open and user will select PPT file from there.please suggest how to set the path pragmatically for browse button (file open dialog) on reuse slide pane of powerpoint in c# vsto.

Thanks in advance.   


ActionsPaneControl Missing VS2015 & VS2017

$
0
0

I have both the VS2015 & VS2017 community editions. I have the Office Tools for both editions. I am trying to develop an VSTO Excel 2013 - 2016 VSTO Addin. i added the Ribbon and when I try to add an ActionsPaneControl (Project, Add New Item) the option (template) is not in the list of choices under C# and Windows form, Office/Sharepoint, etc . I did a search also and came up empty

Where is the ActionPaneControl or Task Pane control. How to add it

Excel VSTO Add-In using Application.VLookup with Early Binding

$
0
0

I'm wrecking my Brains...not getting anywhere.

I am working on an Excel Add-in with VB.net and want to use early binding (Option Strict On). However, I am getting an error when trying to use Excel's worksheet function Application.VLookup(Target, WSobj.Range("A:D"), 4, False). The error is "Option Strict disallows late binding".

However, I can not get this Thing to work...whatever I try for early binding does not seem to work. I've tried this, for instance:

Dim xlApp as Excel. Application
xlApp = Excel.Application
xlApp.Visible = True
tmp = xlApp.Vlookup(Target, WSobj.Range("A:D"), 4, False)

No success - Option strict on disallows late binding. I've tried to declare xlApp outside the procedure on class Level - didn't work. I've tried a bunch of other things but to no avail. If I set Option Strict Off everything is fine...

Any advice?

Thanks in advance,
Joe


Viewing all 5157 articles
Browse latest View live


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