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

Skype 2013 & Word 2010 incompatibility

$
0
0

Hi

We are beginning to get problems with our VSTO Add In for Word, which has been working for several years.

We are very suspicious on a couple of circumstances regarding our clients.
The problems started when the customer began deploying Lync and Skype for business clients.
Initially they managed to find out which version of Skype for Business 2013 that was compatible with Microsoft Office 2010, and especially Word 2010.

Now it seems they have lost track of deployed Skype/Lync versions, but considering the amount of Skype versions released from Microsoft, I am not surprised.

Are there any recommendations available regarding the combination of these products?

At the moment the clients with problems are running this:
Microsoft Office Standard 2010, version 14.0.7208.5000 32-bit
Skype for business - Microsoft Lync 2013 15.0.4737.1000 MSO (15.0.4711.1000) 32-bit


Best Regards Peter Karlström Midrange AB, Sweden


Questions regarding Access Interop libraries

$
0
0

Hello,

I do hope I am in the right forum regarding some of those topics.

I want to know how to perform the following step.

How to invoke a DLookup function while using the Access Interop library.

For the past several years, I have viewed over various advanced tutorials in Access VBA using those functions.

So far, none of them have been implemented into Vb.net forms.

In addition, I would like to learn more on how to invoke Record sets while using the same related library.

Regards,

JohnDBCTX


jp

Having Word VSTO Add-in and VSTO Document in the same solution

$
0
0

Hello all,

I am fairly new to the VSTO world and I am just trying to evaluate the scenario mentioned in the title.

More specifically, I have a solution (ex. MyVSTOSolution), I add a new Word 2013 and Word 2016 VSTO Add-in project (ex. MyVSTOAddin) where I handle my custom ribbon and the _Startup/Shutdown events.

I then add a Word 2013 and 2016 VSTO Document project (ex MyVSTODocument), where I perform some extension on a document.

Currently I am not able to reference and use the .docx from MyVSTODocument from the MyVSTOAddin, ex. have a ribbon button or a task panel open it/edit it.

The end goal is to have a solution with the addin and multiple documents/templates which I can use/reference from my addin. Or this is not the way to do it or even possible? 

Best way to Deploy VSTO Addin?

$
0
0

Hello I have Excel 2019 and Visual Studio 2017.

Can someone guide me what are ways to deploy VSTO addin ?

How can I change the add-in's name displayed to the user at installation confirmation?

$
0
0

Hello,

We have developped a couple of add-ins for some Microsoft Office applications. We have successfully implemented all of our functionalities and incorporated them in the installation of our main product. However, we have so far not succeeded in changing the name displayed to the user when they first launch the Office Programs:


The "From" and "Publisher" fields are fine, but we would like the "Name" field to be different. As it is today, it displays <Assembly's name> - <Assembly's name>.

I have tried playing around with the various fields in the .dll.manifest file and managed to change it to <Assembly's name> - <Friendly name>, where <Friendly name> is the content of the element <vstov4:friendlyName>, which is in the element <vstov4:appAddIn>, in <vstov4:customization>, in <vstov4:customizations>, in <vstav3:application>, in <vstav3:addIn>, in <asmv1:assembly>, which is the root element...

I have not yet been able to change the first part of the name, even after altering every occurence of <Assembly's name> in the manifest file. 

Changing the manifest file after it was generated also mean I had re-sign application and deployment manifests with mage.exe. We would like to avoid doing this as it would mean invoking two command lines containing our certificate's password in our build process.

Hence the following questions:

  1. How can we change the first part of the name displayed to the user?
  2. Is there a way to change the second part (and the first) in the generated .dll.manifest file, so that we do not have to change them after the manifest is generated and to resign the application and deployment manifests?

In advance, thanks for your time and for answering my questions.

Regards,

Quentin

Creating a Map Chart in PowerPoint

$
0
0

I'm trying to add a map chart in PowerPoint.

As of now I can't see the option to do so in XlChartType, but if I insert one manually I can then examine the inserted chart and see, that its XlChartType evaluates to 140.

If I try to insert a chart with this type I get a map as expected. However, if I try to access its workbook it throws an exception. These two lines of code should explain what I'm doing:

var chart = _slide.Shapes.AddChart((XlChartType)140).Chart;
var workbook = (Workbook)chart.ChartData.Workbook;

I assume this is related to the fact that it's not officially supported. Is there any way to work around this problem and edit the data of the chart?

Outlook FormRegion design

$
0
0
I would like to style my FormRegion so that it matches the selected Outlook theme.  So, for example, I would like the background colour of my FormRegion to be the same as the background colour of the message pane and the font to be the same as the Outlook font.  Is there some way to detect or default to the values of the selected Outlook theme?

VSTO | Word | Paragraphs | Sentences

$
0
0

Hello,

I'm a little confused about the Range.Sentences object and how it should be used. I'm finding that the collective text from all the contained sentences doe snot always add up to the same text as the Range.Text property. Usually I seem to be missing the last sentence with the last Sentence in the Range.Sentences object just being '\r\a'?

In particular I'm finding this to be true in table cells - usually the last cell in a row!

Any suggestions would be gratefully received.

Martin



How to insert a docVariable field without changing the Word source content?

$
0
0

Hi all,

in a recent project, I need to insert some kind of markers in the Word source document without changing the content/text. I end up using doc Variable to do that and it works until hitting the use case when track changing is enabled. When adding the doc Variable to the document, I need to specify a value, which should be the text of the range of a place of interest, e.g., a bookmark, in the source document, since I don't want to change the content. After adding the doc Variable to the range as a field, Word automatically replaces the range text with the doc Variable value, which is actually the same as the range text. However, when the track change flag is on, the color and style (e.g., underline) will be changed and modification on the source document is noticeable, as shown in the screenshot below.

Image

The followings are the related C# code. Note that the lines to add underline and change text color won't work for an unknown reason. Please let me know if there is a way to fix this issue or if anything is wrong or there is an alternative solution without using docVariable to achieve what I need. Thanks in advance!

wordDocument.TrackRevisions = false;

wordDocument.ActiveWindow.ActivePane.View.RevisionsFilter.Markup = WdRevisionsMarkup.wdRevisionsMarkupNone;

//suppose the current range is for the heading "ANALYSE DE MARCHE" and the marker we want to embed is "docVarName", i.e., the name of the docVariable

wordDocument.Variables.Add(docVarName, range.Text);

Object obj = range.get_Style();

wordDocument.Fields.Add(range, WdFieldType.wdFieldDocVariable, docVarName, true);

range.set_Style(obj);

range.Font.Underline = WdUnderline.wdUnderlineSingle;

range.Font.ColorIndex = WdColorIndex.wdDarkRed;

range.Fields.Update();





Unable to install Addin Created using VSTO

$
0
0

I have created a outlook ribbon using VSTO tool.

It works fine in user's desktop if installed using Click Once. However it always refers to the deployment path for VSTO file instead of referring to a path in user's machine.

I have also tried to create a Windows Installer Package but the Addin is failing to load in Outlook. 

I have followed the instructions mentioned in following link.

https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2010/ff937654(v=msdn.10) 


SubhoM

VSTO. Is it possible to display a user define from region when click a explorer folder.

$
0
0

I'm beginning to create a VSTO ,outlook addin .And i want to show my form region when i click one folder named: User Informations.

I have set the Application.ActiveExplorer() 's event  BeforeFolderSwitch  , bug i don't know how to display my form

and there's a picture 

Communication between Excel UDF addin and VSTO addin

$
0
0

Hi. Hope someone can help.

I have created an Excel UDF addin which fetches some data from a database into an Excel cell, this all works fine.  I have also created a VSTO Excel addin which assists the user in creating the formula required for the UDF.  This also accesses the same database as the UDF, and again, this all works fine.  I now would like to streamline things a little, for example I would just like to use the one data connection.  I therefore either need to expose a property from from UDF addin to my VSTO addin, or from my VSTO to UDF. 

I have read countless articles (for example http://blogs.msdn.com/b/andreww/archive/2007/01/15/vsto-add-ins-comaddins-and-requestcomaddinautomationservice.aspx) on exposing properties from a VSTO addin and have successfully managed to expose my VSTO property to Excel VBA via the Office.Addin.Object property.  However, because my UDF addin does not have access to the Excel application object I cannot access it.  If someone could give me some idea how I might achieve this it would really help.

I have also tried the same method on my UDF addin, but because it is not a Office.COMAddin object (it is an Excel.Addin object), it therefore does not have an object property and the solution will not work.  Perhaps I am looking at the problem in the wrong way?

Any suggestions would be greatly appreciated.  Thanks.


Alan Moseley

Problem - Create Outlook 2016 VSTO Add-in Setup installer using VS Community 2017

$
0
0
Hi Experts,

I have developed a VSTO plugin for outlook 2016 using VS Community 2017 in my Win10 machine. 

After that , I installed Microsoft Visual Studio 2017 Installer Projects through ‘Extensions and Updates’ because the ‘other project type’ in VS 2017 doesn’t have Setup and Deployment project template.

And then I developed a setup project for that Outlook Add-in, so far everything looks good to me.

But when I build this setup project, it said ‘Please wait while Windows configures Microsoft Visual Studio Professional 2013…   Gathering required information…” , and then prepare installing…
and hang there forever.

Deploying an Office Solution by Using Windows Installer
This link is not helpful for me, because it needs InstallShield Limited Edition

I got the following information from the Flexera ( the owner of InstallShield)
*InstallShield Limited Edition for Visual Studio is included with Visual Studio versions 2010 through 2015.
InstallShield Limited Edition for Visual Studio supports the following Visual Studio editions:
Professional
Premium
Enterprise
Ultimate
*Visual Studio Community Edition is not supported.



So I doubt, Office VSTO Add-in Setup installer is not supported from VS Community 2013 to VS Community 2017.

Can anyone please help me with this issue? Do I have to use VS Professional Edition to solve this problem?

Any advices are very welcome.

Thanks,


VSTO and VBA - cannot reference to Range / Selection

$
0
0

Hi!

I have made changes to the Excel UI using the "Custom UI Editor for Microsoft Office" - using XML and VBA.

Now I have started looking at changing the UI using VSTO instead, but I get problems when I want to reference Range / Selection in VBA:

(1st) Question: Why do I have to put "Excel." in fron of the "Range" in line 35?

(2nd) Question: The normal usage of "For Each Cell in Selection.Cells" is somehow wrong (although it is fine in normal VBA)? Any help here?

(3rd) Question: The same as (2nd) - what is wrong with the "Cell.Text = "ABC"?

I am stuck for days now - so any help is appreciated!

Thanks!

excel currency format

$
0
0

hi All,

 

from an web service i will be getting currency (e.g.: USD 35.45) as string .

i need to convert this to a currency format and also manipulation should be possible

(i.e it should be string anymore when pasted in the cell).  what is possible way to do this

 

Thanks in advance

 


Excel Error with VSTO design-Time adaptor for excel

$
0
0

Since I installed VSTO 2015 I get an error whenever I open Excel I get an error:

The call to GetCustomUI() for RibbonID "Microsoft.Excel.Workbook" Failed

I know that it is raised by the VSTO addin "Visual Studio Tools for Office design-Time adaptor for excel"

If I disabled it in excel, Visual studio doesn't let me to create an excel document project.

Thank you in advance.



Visual Studio Word VSTO The RPC Server is unavailable

$
0
0

Creating a new VSTO project in Visual Studio 2017 for a word template 2013-2016 results in word crashing and visual studio reporting The RPC Server is unavailable. In the venet viewer under application log the word crash is logged as;

Faulting application name: WINWORD.EXE, version: 16.0.11029.20070, time stamp: 0x5bef9649
Faulting module name: ucrtbase.dll, version: 10.0.17763.1, time stamp: 0xc3ae1887
Exception code: 0xc0000409
Fault offset: 0x000a5d0b
Faulting process id: 0x368c
Faulting application start time: 0x01d485a1efc335e3
Faulting application path: C:\Program Files (x86)\Microsoft Office\Root\Office16\WINWORD.EXE
Faulting module path: C:\WINDOWS\System32\ucrtbase.dll
Report Id: 892e703b-b741-4278-9b54-e348ed398b44
Faulting package full name: 
Faulting package-relative application ID: 

Everything is up to date, sfc /scannow reports no issues. office repair yields no difference. Changing .Net version changes nothing (in setup of new VSTO Project).

I have a question about customtaskpane in MS WORD

$
0
0

Hi,

I'm developing a customtaskpane in MS WORD.

There was a problem in the course of development. 

When I run two programs, The customtaskpane can only be seen from one place. Like the picture above.

Is there any way to solve this problem?

ThisAddin.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using Word = Microsoft.Office.Interop.Word;
using Office = Microsoft.Office.Core;
using Microsoft.Office.Tools.Word;
using System.Diagnostics;

namespace WordAddIn2
{
    public partial class ThisAddIn
    {
        private Microsoft.Office.Tools.CustomTaskPane pane;
        private CellTaskPane ctrl = new CellTaskPane();

        private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
            pane = CustomTaskPanes.Add(ctrl, "Custom Sheet");
            pane.DockPosition = Office.MsoCTPDockPosition.msoCTPDockPositionRight;
            pane.DockPositionRestrict = Office.MsoCTPDockPositionRestrict.msoCTPDockPositionRestrictNoChange;
            pane.Visible = false;
            pane.VisibleChanged += new EventHandler(taskPaneValue_VisibleChanged);
            ctrl.SetName("test");
        }

        private void taskPaneValue_VisibleChanged(object sender, System.EventArgs e)
        {
            Debug.WriteLine("pane.Visible : " + pane.Visible);
            Globals.Ribbons.Ribbon1.toggleButton1.Checked = pane.Visible;
        }

        public Microsoft.Office.Tools.CustomTaskPane TaskPane
        {
            get
            {
                return pane;
            }
        }

        public CellTaskPane MyContainer
        {
            get
            {
                return ctrl;
            }
        }

        private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
        {
        }

        #region VSTO generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InternalStartup()
        {
            this.Startup += new System.EventHandler(ThisAddIn_Startup);
            this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);
        }

        #endregion
    }
}

Ribbon1.cs

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using Microsoft.Office.Tools.Ribbon;

namespace WordAddIn2
{
    public partial class Ribbon1
    {
        private void Ribbon1_Load(object sender, RibbonUIEventArgs e)
        {

        }
        private void toggleButton1_Click(object sender, RibbonControlEventArgs e)
        {
            Globals.ThisAddIn.TaskPane.Visible = ((RibbonToggleButton)sender).Checked;
            Debug.WriteLine(Globals.ThisAddIn.TaskPane.Visible);
        }

    }
}

cellTaskPane.cs

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WordAddIn2
{
    public class CellTaskPane : System.Windows.Forms.UserControl
    {
        public System.Windows.Forms.TextBox test;

        public CellTaskPane()
        {
            InitializeComponent();
        }

        public void InitializeComponent()
        {
            test = new System.Windows.Forms.TextBox();
            test.Location = new System.Drawing.Point(120, 8);
            test.Size = new System.Drawing.Size(232, 20);
            test.TabIndex = 0;
            Controls.AddRange(new System.Windows.Forms.Control[] { test });
            Size = new System.Drawing.Size(375, 150);
        }

        public void SetName(string text)
        {
            test.Text = text;
        }

        public string GetName()
        {
            return test.Text;
        }
    }
}

How to programaticaly open files in microsoft power point from google drive, dropbox, MS oneDrive on web in C#

$
0
0

i am working on vsto application for opening ppt file in the MS power point. i am working on the client requirement in which on browser if end user access the file in google drive, dropbox, One drive then it will open that file locally using my vsto application.

in short, i am tries to bridge the interoperability gap between VSTO application and cloud services using there own Web application (browser UI) . how i can achieve this task.

i tried this with google drive api, drop box api but its allow to get the file list programaticalyafter successful authentication. and i am able to download the files by hitting the API calls. but as per requirement, i need to get the PPT file open in my app after user click it on browser.

is there any kind of connector services present to bridge the gap between VSTO app and browser request/ response ?

i am using dot net framwork 4.5 c# VSTO for my project. any help appreciated.

identifying TaskItem in Outlook ItemSend event

$
0
0
Hey everybody

I am catching sent objects from the ItemSend event, and I need to recognize which object is the sent item.

So here is what I am doing:
void Application_ItemSend(object Item, ref bool Cancel)
{
            if(item is Outlook.MailItem)
            {
                Trace.WriteLine("MailItem");
            }
            else if(item is Outlook.MeetingItem)
            {
                Trace.WriteLine("MeetingItem");
            }
            else if (item is Outlook.AppointmentItem)
            {
                Trace.WriteLine("AppointmentItem");
            }
            else if (item is Outlook.TaskItem)
            {
                Trace.WriteLine("TaskItem");
            }
            else
            {
                throw new Exception("Unknown sendable item type: "+item.GetType().Name);
            }
}
Now, when I am sending a Task to someone else, I expect to get a TaskItem, but that is not the case(!), and I am getting to the exception instead.

How can what type is the object I am getting? (I also checked ReportItem and it wasn't that either).
How can I get TaskItem I need from the event ?


Thanks a lot in advance!!!
Viewing all 5157 articles
Browse latest View live


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