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

Visual Studio (Visual Basic) > VSTO Add-In : Following Excel progress step by step during runtime from breakpoint not possible

$
0
0

Hello dear forums and team members,

After a long time researching Google and forum posts, I am at the end of my wisdom.
I switched from VBA to VB and used the WPF-VB (.Net-Framework) project template successfully. Here, however, I was never able to create add-ins or event handlers in the Excel file and I did it with VBA.
I recently came across VSTO and thought my problems VBA time was a thing of the past. Now, however, I had to find in VSTO-Add-IN that I cannot track the progress in the Excel folder during the debugger runtime while at a breakpoint, let alone change the data in the Excel file.
I have setxlApp.ScreenUpdating = True;
xlApp.Interactive = True; xlApp.EnableEvents = True but these things has no effect.
After all, I have to be able to follow the effects step by step in Excel for complex programs during the debugger runtime.

Can someone please help me here

Thank you very much

Attila


Adding a second EXcel worksheet via VB.net

$
0
0
I am looking for an example adding a second worksheet to an Excel Workbook using VB.net.

Data filter option Microsoft Word ?

$
0
0

Hello,

I have a huge table database in Microsoft Word document. I want to figure out that information using the command like filter (similar to Excel) 

Is it possible to insert a filter button in the header of a table in Microsoft Word to easily filter data ? 

Please suggest the possible solution.

Thanks in advance..!!


VSTO Outlook: Create buttons in Run-Time

$
0
0

All

I have been searching on the internet for a solution, but do not quite find what I want.

My goal is to create a ribbon in Outlook main application which gives an overview of business applications the logged on user can launch.  So I have a database which indicates which user can access which business application (and the related query is sorted upon username - applicationname)

Let's assume user Tony has access to business application A, C and E.  The ribbon must then dynamically add three buttons which launch the related application.  These three buttons should be next to each.

Let's assume user Pam has access to business application, A, B, C and E. The ribbon must create four buttons but these should be next to each.

With other words: I could have created a predefined ribbon with all of the bussiness applications and hide those items which are not applicable for a user.  This is not what I want. I want all of the applicable buttons next to each other, so I think the best solution is to create them dynamically.

Regards

loosing filter property in AutoFormatRules (conditional formatting) on folders.

$
0
0

Hi All,

I am using vsto 4 with VS2010 and developing the addin for office2010 outlook.

I am tring to add conditional formatting on a folder. My below code is creating the conditional formatting and showing correctly but if i am moving between folders then its loosing its condition and start showing the formatting on all the folder items. I also checked the conditional formatting at the time of creation when its working fine in outlook, i try to check the filter condition by UI but its showing nothing there.

privatestaticvoid SetFormattingRuleFor(_TableView caseView)
        {if (caseView == null) return;for (var i = 1; i <= caseView.AutoFormatRules.Count; i++)
            {var rl = caseView.AutoFormatRules[i];if (rl.Name == "PartialDownloaded") caseView.AutoFormatRules.Remove(i);
            }var rule = caseView.AutoFormatRules.Add("PartialDownloaded");
            rule.Filter = TextHelper.GetSearchField(CustomProperty.PartialDownloaded) + "\" = 1";
            rule.Font.Italic = true;
            rule.Font.Color = OlColor.olColorGray;
            rule.Enabled = true;
            caseView.Save();
            caseView.Apply();
        }

If i am giving the filter condition by UI then it is keeping but if giving the filter condition from program then its loosing it.

Does i am missing something or its any issue in VSTO. Is there any work around by Redemption because we are using redemption as well in our application.

Thanks in advance.

Regards
Anand

 


Anand

Word 365 not loading VSTO installed per-machine, but loads if installed per-user (not checking HKLM registry keys, only HKCU)

$
0
0

Hello,

I am developing an add-in for Word 365 and am running into an issue when attempting to install the add-in to the machine. The installer was created with WiX toolset and places the proper registry keys in both:

  • HKCU\Software\Microsoft\Office\Word\Addins\[Add-in Name]
  • HKLM\Software\Microsoft\Office\Word\Addins\[Add-in Name]

The user with the registry keys installed in their HKCU hive is able to access the add-in, however other users who log into the machine are not able to, despite the registry keys in the HKLM hive. From additional testing, it does not look like Word is even attempting to access the keys in HKLM. This is not an issue with Word 2016.

Has anyone encountered this issue before? Was there a change in the way Word/Office 365 handles per-machine installs of VSTO add-ins?

Thank you.

Upgrade Outlook addin project into office 365

$
0
0

hello all,

im having a outlook addin project runs in Outlook 2007, now i would like to upgrade this project to support on Outlook365 desktop version.

this addin project has a assembly referrence like below

as well there is a file in solution control explorer like below, i dont know what file is this and how to upgrade the project to support outlook365? experts please advice me.


Thanks In Advance, Jeyaseelan

Queue vNext build from c# using REST API (Tfs on premise)

$
0
0

This work great:

HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://v-tinmo-12r2:8080/tfs/DefaultCollection2015U2/ScrumStarain/_apis/build/builds?api-version=2.0"); request.Credentials = CredentialCache.DefaultNetworkCredentials; request.Method = "Post"; request.ContentType = "application/json"; Stream stream = request.GetRequestStream(); string json = "{\"definition\":{\"id\":1}}"; byte[] buffer = Encoding.UTF8.GetBytes(json); stream.Write(buffer, 0, buffer.Length); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); Console.Write(response.StatusCode); using (var streamReader = new StreamReader(response.GetResponseStream())) { var result = streamReader.ReadToEnd(); } Console.Read();

But when i'm trying to add parameters its not working.

when I do the POST from powershell its work great but i'm not convert it to json before the call.

$json = "{
    'parameters':  '{ \'param1\':  \'\test\""\',\'param2\':  \'\""test2\""\'}',
    'definition':  {'id':  231}
}"

$build = Invoke-RestMethod -Method Post -UseDefaultCredentials -ContentType application/json -Uri "http://tfs-app:8080/tfs/DefaultCollection/ALM/_apis/build/builds?api-version=2.0" -Body $json

Why its doesn't work with C# web request?

BTW, when I do the call from POSTMAN with this body:

{"definition":{"id":231},"parameters":{"FileToCheckInFullPath":"test"}}

I got:

"{"$id":"1","innerException":null,"message":"This request expects an object in the request body, but the supplied data could not be deserialized.","typeName":"Microsoft.TeamFoundation.Build.WebApi.RequestContentException, Microsoft.TeamFoundation.Build2.WebApi, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a","typeKey":"RequestContentException","errorCode":0,"eventId":3000}"

But when I change the word "parameters" to any other word its work, the build queued but with empty params.

Anyone can help? 

Thanks.


Get selected appointment shared folder's stmp address

$
0
0

Hi, 

I have many shared calendars opened and I have selected an appointment on one of them. I would like to get this appointment calendar's stmp address. 

Is there a way for doing it?


Visual Studio 2019 tools for office 2016

$
0
0

hello all,

i have created new Outlook AddIn project using Visual Studio 2019, C# for Office 2016. now the problem is , i have written code like below

Private Sub ThisAddIn_Startup() Handles Me.Startup
        Try
            Dim Application As Microsoft.Office.Interop.Outlook.Application = New Microsoft.Office.Interop.Outlook.Application

.......................

exactly when it reach the first line then error comes as "Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE))."

Im using Microsoft.Office.Interop.Outlook version 15.0.0.0, runtime version v2.0.50727. Is there any other advanced Interop available for Office 2016? If so, where may i download and use it? 

experts please advice me


Thanks In Advance, Jeyaseelan

Error: The underlying connection was closed: An unexpected error occurred on a receive in VSTO project

$
0
0

I created a VSTO project to build an add-in for outlook 2016. In the project, I am calling an POST API to upload a file to the server. It suddenly stopped working yesterday. I am getting 4 errors when execute the PostAsync:

1. HttpRequestException: An error occurred while sending the request.

2. WebException: The underlying connection was closed: An unexpected error occurred on a receive.

3. IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.

4.  SocketException: An existing connection was forcibly closed by the remote host

I did some research and find the solution here. https://stackoverflow.com/questions/28286086/default-securityprotocol-in-net-4-5

So I changed my code as 

var stream =newFileStream(filePath,FileMode.Open);var content =newStreamContent(stream);
client.DefaultRequestHeaders.Add("X-Atlassian-Token","nocheck");System.Net.ServicePointManager.SecurityProtocol|=SecurityProtocolType.Tls11|SecurityProtocolType.Tls12;var response = client.PostAsync(apiUrl, content).Result;

But I am still getting the same error. Does this has sth to do with VSTO project itself? I am using .net framework 4.6.1 and windows 10.

The strange part is, if I am making the same API call in POSTMAN or coded in PowerShell script to call it, the API works without any error. If I am calling the same PowerShell scripts(which was working when I run in the PowerShell command line) in my VSTO project. I am getting this similar error: Exception calling "UploadFile" with "2" argument(s): "The underlying connection was closed: An unexpected error occurred on a receive.

The core part of the PowerShell script:

$wc =New-ObjectSystem.Net.Webclient
$wc.Headers.Add("Authorization","Basic $global:token")
$wc.Headers.Add("X-Atlassian-Token","nocheck")
$wc.UploadFile($url, $(Resolve-Path $attachment))> $null

Does anyone know how to fix this error in VSTO project?




where to download VSTO 2016?

$
0
0

using visual studio 2019, i have created an outlook 2016 addin.

in websites, i could see Visual Studio TOols for Office 2010 but, where may i download VSTO 2016?

thank you experts


Thanks In Advance, Jeyaseelan

Install a VSTO from Edge (based on Chromium)

$
0
0

I used to be able to install a VSTO from a link, to the vsto file, in a web page displayed in either Microsoft Explorer or Microsoft Edge.

Edge from v79 is now based on Chromium and it no longer seems possible to be able to install directly from a link to the vsto.

Is there a setting I haven't found? Possibly an addon to install into Edge - although my users won't like or do that.

Is Explorer now the only browser that supports installation of a VSTO?

Thanks

New button in outlook navigation bar

$
0
0
Hello everybody,
can someone give me a tip on how to add a new button in outlook navigation bar?
greetings
Frank


Is it possible to call VBA (sub or function) from ribbon added through VSTO

$
0
0
I am working on a project where I have a Visual Studio C# Excel Add-in project (VSTO). From the VSTO code I am adding a Ribbon with a button to Excel (Office.IRibbonExtensibility).
From the so added button in Excel I can make callback calls to methods in the C# code (in the VSTO add-in).
I am looking (and not finding) for the way to call VBA (sub of function) from that button to VBA code that is in the Excel file.
In other words, from that described button I know how to call code that is in C# but don't know how to call VBA code that is in the Excel file itself.
I spent quite some time searching for information and testing some blind ideas but no success either finding anything or getting some good results from my tests.
I would appreciate a kick start in the right direction.

Outlook 2016 Addin not loading form region BUG only office 365 Outlook 2016

$
0
0

1. 

Mail item opened from Drafts in preview pane don't have mode olFormRegionPreview . item have mode OlFormRegionMode.olFormRegionCompose  its error !!!!!

2

You cannot vote on your own post
0

Open Visual studio 2016-2019, create VSTO Outlook project and add Form region. Set button an form.

run project.

1. Open Outlook

2. Open Mail item from Outlook (Add-in and Form region visible all work ok!)

3 Close Mail item.

4 Open Mail item from file   as file.msg get  BUG ( Add-in working , checked from debugger, Form region is empty can see only NAME of Form region)

Open Mail item from Outlook get  BUG ( Add-in working , checked from debugger, Form region is empty can see only NAME of Form region)

6 Close all Mail item .

Open Mail item from Outlook (Add-in and Form region visible al work ok!)

8 Don't close opened Mail item and  Open Mail item from file   as file.msg get  (Add-in and Form region visible all work ok!)


Question
You cannot vote on your own post
0

Set DsplayConditions -> ShowInspectorRead =true And ShowReadingPane = True

All work but you get error RWC cannot be used ! 

Add to the code FormRegionShowing()

if this is ShowReadingPane set this.OutlookFormRegion.Visible = false;

its all !!!!

Manage group calendar C#

$
0
0

Hello everyone,

I have worked on some VBA codes to retrieve a list of calendar within a calendar group.

This first work was to get a hold of how I can interact with (in my case) Outlook components.

So far so good, next goal was about to adapt my code for an VSTO Addin (deployment, yeah).

As ignorant as I am, I have thought that VBA and C# was not that much different and that the VBA api was about the same as the C# one. How foolish of myself. After, reading much of what the doc holds, I can't get a way to retrieve the content of my calendar group (which is managed manually : adding and removing action are perfomed manually, I only need to read its content).

My working VBA code :

Dim objExpCal As Outlook.Explorer
Dim objNavMod As Outlook.CalendarModule
Dim objNavGroup As Outlook.NavigationGroup
Dim objNavFolder As Outlook.NavigationFolder

Set objExpCal = Session.GetDefaultFolder(olFolderCalendar).GetExplorer
Set objNavMod = objExpCal.NavigationPane.Modules.GetNavigationModule(olModuleCalendar)
Set objNavGroup = objNavMod.NavigationGroups.Item("RandomGroup")
For Each objNavFolder In objNavGroup.NavigationFolders
    On Error Resume Next
    ' Do stuff
next


Set objExpCal = Nothing
Set objNavGroup = Nothing
Set objNavMod = Nothing
Set objNavFolder = Nothing

If a goodwill hand could reach me, it will help me having a better after taste for the first time after several day of losing hair on that matter...

Thanks 

Customizing Context Menus in Outlook 2016 - Context Menu Does not appear

$
0
0

Hello,

I am trying to implement a custom context menu item in the Outlook Read Only Mail Item window (i.e. when you open an email by double clicking the mail item in explorer to just read the email). When the user marks a text within the email and right clicks the text, the context menu will show an option "Search". Click the option "Search" will hit an API End Point to search that string within our content eco systems. Here is my Ribbon XML (Filename: ContextSearch.xml):

<?xmlversion="1.0"encoding="UTF-8"?>

<customUIxmlns="http://schemas.microsoft.com/office/2009/07/customui"onLoad="Ribbon_Load">

  <ribbon>

  </ribbon>

  <contextMenus>

    <contextMenuidMso="ContextMenuReadOnlyMailItem">

      <buttonid="MyContextMenuText" label="Search" onAction="RibbonMenuClick"/>

    </contextMenu>

  </contextMenus>

</customUI>

However, the above XML does not show the context menu that I have created. I have overridden the GetCustomUI Method as well, as shown below:

publicstringGetCustomUI(stringRibbonID)

{

           

stringribbonXML = String.Empty;

if (RibbonID =="Microsoft.Outlook.Mail.Read")

{

returnGetResourceText("ContextSearch.xml");

 }

returnribbonXML;

 }

Another help I would request is to point me to any useful reference to understand the various Outlook Tabsets, Controls. I did download the excel filse with the list of all msoIDs. However, it only lists the tabset and control ids. If there is any descriptive reference of what each tabsets or control IDs map to, please point me to the same. Also, is there a documentation that tells what are the various windows like Explorer, Compose etc.? Any help would be much appreciated.

Thanks in advance.

Regards

Narayanan


How to create a "VSTO"-setup package in Visual Studio 2019?

$
0
0

All

I created a VSTO (Outlook Add-In) which works fine on the machine where I have Visual Studio 2019 installed.
I installed the “Microsoft Visual Studio Installer Projects” and created a setup.exe (and setup.msi) according instructions. I did add the “Primary output” of my project. The setup-project automatically adds some dependencies. I can rebuild the setup-project and the EXE and MSI are created.

When I use the "setup.exe" (or setup.msi) the setup works as expected and files are copied to the given folder in the setup-project. However, when I launch Outlook the “add in” is not visible in the toolbar whereas it does show up on my own computer. The add-in is neither visible under File - Options - Add-Ins (also not in “disabled items”). I tried to add the Add-in via the Browse button and double-clicked some of the files in the installation folder, but then I get errors it is not a valid plugin.

So how do I create a setup for a VSTO?

Conflict with Azure Information Protection PowerPoint add-in

$
0
0

At a customer site our PowerPoint add-in cannot run simultaneously with the Azure Information Protection add-in. If AIP add-in is disabled, our add-in loads and work fine, but when the AIP add-in is enabled, PowerPoint crashes. How can we get Microsoft support for this issue?


Viewing all 5157 articles
Browse latest View live


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