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

my computer show the "vstor40_LP_x86_chs.exe " haved a " failed with 0x80070643 " for installing of office runtime

$
0
0

dear :  hope get a great help.....,thank u a lot

bellow is the detailing about the problem:

OS Version = 6.1.7601, Platform 2, Service Pack 1
OS Description = Windows 7 - x86 Enterprise Edition Service Pack 1
CommandLine = e:\436ce22782815971133e4dd7\Setup.exe /qb
Using Simultaneous Download and Install mechanism
Operation: Installing
Package Name = Microsoft Visual Studio Tools for Office Runtime 2010 Setup
Package Version = 10.0.60724
User Experience Data Collection Policy: UserControlled
Number of applicable items: 4
Item Failed. OnFailureBehavior for this item is to Continue.
Patch (e:\436ce22782815971133e4dd7\VC_Red_x86\msp_kb2565063.msp) Install succeeded on product (Microsoft Visual C++ 2010 x86 Redistributable - 10.0.40219). Msi Log:
Exe (e:\436ce22782815971133e4dd7\vstor40\vstor40_x86.exe) succeeded.
Exe (e:\436ce22782815971133e4dd7\vstor40\vstor40_LP_x86_chs.exe) failed with 0x80070643 - 安装时发生严重错误(means for chinese ,show the big error...) .
Final Result: Installation failed with error code: (0x80070643), "安装时发生严重错误 (means for chinese ,show the big error...) " (Elapsed time: 0 00:01:11).



Simulate a click on "Skype Meeting" in Outlook

$
0
0

Hello,

I'm trying write an Outlook plugin that will simulate a click on "Skype Meeting" button in Outlook 2016 

I was trying to use Inspector.CommandBars.ExecuteMso("OnUCExplorerOnActionO14"); but no luck

Any idea how to invoke a button in Outlook ?

MS Powerpoint(.PPTX) Document Custom properties not visible if file downloaded from google drive

$
0
0

I am creating VSTO MS PowerPoint plug-in in .net c#.

Programmatically I add some custom document properties to the PPTX document and using API I upload it on Google Drive. So when I download the same uploaded file from Google drive then Document custom properties are missing.

I observe that Powerpoint is opening the file in Protected view and I already try with following manually in powerpoint,

  1. Go to File-> Option->Trust settings and off the protected view.
  2. Enable All macros.

but when I tried to regenerate the case then also it's not showing the Custom properties of the document if I download the file from Google Drive

Any kind of help appreciated. what should I need to do on this so I can get the custom properties after I download the file from Google drive

How do I create a web application user interface?

$
0
0

I have a desktop application which I want to convert into a web application. I am not sure how to go about it. Right now only one user is using it from her desktop. I want to make this a web application save it in a web server so it can be available to more users.

First things first. I need to create a non functional user interface that looks like the currently used interface. I have attached an image of what I want to create.

Any help will be greatly appreciated.

Error installing .vsto AddIn for Outlook on Windows 10

$
0
0

Hello, I am attempting to download a AddIn for Outlook. When I click on the setup.exe file, I get the following error message: Downloading file:///C:/Users/jkumin/AppData/Local/Temp/7zO07012381/DPOAddIn.vsto did not succeed.

Name:
From: file:///C:/Users/jkumin/AppData/Local/Temp/7zO07012381/DPOAddIn.vsto

************** Exception Text **************
System.Deployment.Application.DeploymentDownloadException: Downloading file:///C:/Users/jkumin/AppData/Local/Temp/7zO07012381/DPOAddIn.vsto did not succeed. ---> System.Net.WebException: Could not find file 'C:\Users\jkumin\AppData\Local\Temp\7zO07012381\DPOAddIn.vsto'. ---> System.Net.WebException: Could not find file 'C:\Users\jkumin\AppData\Local\Temp\7zO07012381\DPOAddIn.vsto'. ---> System.IO.FileNotFoundException: Could not find file 'C:\Users\jkumin\AppData\Local\Temp\7zO07012381\DPOAddIn.vsto'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
   at System.Net.FileWebStream..ctor(FileWebRequest request, String path, FileMode mode, FileAccess access, FileShare sharing, Int32 length, Boolean async)
   at System.Net.FileWebResponse..ctor(FileWebRequest request, Uri uri, FileAccess access, Boolean asyncHint)
   --- End of inner exception stack trace ---
   at System.Net.FileWebResponse..ctor(FileWebRequest request, Uri uri, FileAccess access, Boolean asyncHint)
   at System.Net.FileWebRequest.GetResponseCallback(Object state)
   --- End of inner exception stack trace ---
   at System.Net.FileWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Net.FileWebRequest.GetResponse()
   at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
   --- End of inner exception stack trace ---
   at Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.GetManifests(TimeSpan timeout)
   at Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.InstallAddIn()

What steps can I take to troubleshoot or diagnose this issue?

I want to set expiry of word document using c# code. Please help me!

$
0
0
Hi..
I want to set expiry of existing word document using c# code so that it will become unusable after certain days. Additionally i also want to restrict word editing and printing. 
I heard that we can do this using IRM and open xml sdk but not able to find exactly steps how to do that. Actually i want to restrict this in a way that end user does not need to install anything else other than MS Office.
Any help will be appreciated :)

items_ItemAdd event runs multiple times when used on shared mailbox - Outlook C#

$
0
0

Hi all

I have created Outlook add-in where I am checking for every new email coming to shared mailbox.

The add in is used by multiple user on shared mailbox. The add-in will check whether email is a reply or not; if it is then it will move the email to folder X. But the issue is, there are two copies of each email. I have a feeling that since it is used by multiple users, user A sync with the server first, receives new email and email is moved to folder X. Now user B will sync with server, receives the same email, add-in will do the same thing since all users work with cached mode ON.

Here is my code, any help will be appreciated.

Thank you.

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

            Outlook.NameSpace ns = Globals.ThisAddIn.Application.Session;
            Outlook.MAPIFolder inbox = ns.
            GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox);

            outlookNameSpace = this.Application.GetNamespace("MAPI");
            string recipientName = "abc@abcd.com";
            Outlook.Recipient recip = outlookNameSpace.CreateRecipient(recipientName);
            recip.Resolve();
            if (recip.Resolved)
            {
                inbox = outlookNameSpace.GetSharedDefaultFolder(recip, Outlook.OlDefaultFolders.olFolderInbox);
                items = inbox.Items;
                items.ItemAdd += new Outlook.ItemsEvents_ItemAddEventHandler(items_ItemAdd);
            }

        }

        void items_ItemAdd(object Item)
        {
            if (Item != null)
            {
                Outlook.MailItem mail = Item as Outlook.MailItem;
                if (mail.MessageClass == "IPM.Note")
                {
                    try
                    {
                        Outlook.Application app = Globals.ThisAddIn.Application;
                        if (Item is Outlook.MailItem)
                        {
                            if (mailItem.ConversationIndex.Length >= 64)
                            {
                                Outlook.Folder nonInbox = folder.Parent as Outlook.Folder;
                                string FolderName = "Reply";

                                Outlook.MAPIFolder DestFolder = null;
                                try
                                {
                                    DestFolder = nonInbox.Folders[FolderName];
                                }
                                catch
                                {
                                    
                                }
                                try
                                {
                                    mailItem.Move(DestFolder);
                                }
                                catch (Exception ex)
                                {
                                    MessageBox.Show(ex.Message);
                                }
                            }
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                }
            }
        }

Team Foundation Server (TFS) Version 16.131.28226.3 Transaction Log Growth due to TBL_Content Delete

$
0
0

Hi,

We are experiencing transaction log growth against our TFS_DefaultCollection database, have looked to see the cause and notice there a delete happening against the database which looks to cause the growth.

TSQL used:

DELETE  tbl_Content
                    FROM    #filesToDelete d
                    INNER LOOP JOIN tbl_FileMetadata fm WITH (FORCESEEK(IX_tbl_FileMetadata_ResourceId(PartitionId, ResourceId)))
                    ON      d.ResourceId = fm.ResourceId
                    INNER LOOP JOIN tbl_Content c WITH (FORCESEEK(PK_tbl_Content(PartitionId, ResourceId)))
                    ON      c.PartitionId = fm.PartitionId
                            AND c.ResourceId = fm.ResourceId
                    WHERE   d.Id BETWEEN @counter AND @counterEnd
                            AND fm.PartitionId = @partitionId
                            AND fm.DeletedOn IS NOT NULL
                    OPTION (OPTIMIZE FOR (@partitionId UNKNOWN, @counter = 1, @counterEnd = 100))


Is this the most efficient way to remove data? We have regular 1hr transaction log backups and daily diffs/weekly FULLs.

Any help is much appreciated.

Regards

Ian 


Registering to OnClick event of ActiveX control

$
0
0

Unfortunately, I have not been able to figure out how to do the following:

I am developing an Excel Add-In in VSTO / .NET / C#.

I have been able to find out how to get references to the ActiveX controls in a worksheet. It is possible via the worksheet.OLEObjects collection.

I can search that collection for a particular button if I know the name of the button. So far, so good.

But now: How can I register an event handler that gets called when the button is clicked?

I know how it works for Windows.Forms.Controls. You reference to Microsoft.Vbe.Interop.Forms.dll and use its namespace -> Microsoft.Vbe.Interop.Forms.
Is there any equivalent for ActiveXControls?

How to set document Permission (RMS)

$
0
0

Hi,

Using Office you can set permissions on document from ribbon > File > Info > Protect Document >restrict Access. How I can do that from code?

In Outlook it is quit simple you can set MailItem.PermissionTemplateGuid

Word doesn't have such property it has Permission property object but i didn't found  any way to set the permission from policy. I am using Office 2013.

Any idea?

Extract all types of embedded and attachment files from word document

$
0
0

Hi,

i'm using VSTO interop v15 to convert my office documents to PDF. 

I have been stuck up while converting word document which contains embedded and attachments files.

My requirement  is we need to extract those documents(embedded and attachments) and convert them in PDF.

Framework : 4.5

Language : c# 

Thanks



Inserting html file inside content control range adds extra space at end in content control

$
0
0

Hi,

I have a use case where i am getting the content control text change from a word document. I am sending the content control text as html(to keep the formatting). In content control exit event i do

contentcontrol.Range.FormattedText.Copy(); or contentcontrol.Range.Copy()

and then get html from clipboard 

string HTMLCode = Clipboard.GetData(DataFormats.Html).ToString();

The extra spaces are being inserted when i put this html in temp file and then insert it in the content control range:

contentControl.Range.Text = "";
contentControl.Range.FormattedText.InsertFile(tempFilename); or contentControl.Range.InsertFile(tempFilename);

One other thing i noticed is that after repeating this insert html task multiple times the extra space is added for only first few repetitions and then the it does not adds more space in the content control.

How can i stop this extra space added at the end of content control(the extra space is inside content control).

How to debug an Outlook VSTO add-in ?

$
0
0

Hi,

I work on a windows application that communicates with an Outlook add-in through IPC.

When executing both of them on Visual Studio Code, everything works just fine. But, to deploy my application, I turn my application into an executable and my add-in into a .vsto file. After installing the add-in to Outlook and executing my application, it seems like they don't communicate anymore and I can't understand why.

Is there a way to debug an installed Outlook add-in in order to know why they can't communicate ?

I must point out that I didn't wrote the application's code nor the add-in's, I'm no expert in VSTO at all.

Thanks


VS 2017 is not able to create Excel 2013 and 2016 VSTO workbook project, getting the Error: The project cannot be created.

$
0
0

Hi Team,

I am using Microsoft Visual Studio Professional 2017
Version 15.9.17

Microsoft .NET Framework
Version 4.7.2

Micosoft Office Professional plus 2016
Excel 2016 MSO (16.0.4738.1000) 32 Bit

Windows Specifications :
Windows 10 Enterprise 
Version 1709
OS Build 16299.1451

When I am trying to create a new VSTO excel 2013 and 2016 workbook project, it is showing the prompt like "The Project cannot be created". Please help me on this.

Word and Excel 2010 slow to quit upon opening a WPF window in add-in

$
0
0

I am experiencing strange behavior in my VSTO add-ins. I have add-ins for Word, Excel, Power Point and Outlook built in Visual Studio 2010 as Office 2007 add-ins. They all put a button in the existing ribbon. Upon a button click a standard file dialog is immediately shown followed by a WPF window for user input. When I quit Word or Excel after WPF window was opened at least once, there is a significant delay of 5-10 seconds before the app quits. The same behavior under the same circumstances is not observed in Power Point or Outlook.

To test this theory I have commented out showing of WPF window and Word and Excel quit immediately without a delay. So I am blaming this on WPF. Are there any considerations for WPF usage from a library such as VSTO add-in? Is there any special initialization or shutdown that needs to be performed? Is what I am trying to do supported at all?


Add new Worksheet c# (doubts)

$
0
0

Hi everyone!

I'm working with C# and Excel for the first time ... And I would like to know how can I add a new worksheet in a Workbook. I have been reading some posts but none works for me so I'm going to post my code.

Microsoft.Office.Interop.Excel.ApplicationExcel=newMicrosoft.Office.Interop.Excel.Application();Excel.Workbooks.Add();Microsoft.Office.Interop.Excel._WorksheetWorksheet=Excel.ActiveSheet;

And with this code I am working with my only Sheet, but now I want to add another one with MMPP name but I can't ... After this I would like to make a dynamic table in the Worksheet MMPP. Can you help me a little?

Thank you for read and try to help!

idMso for Outlook 2019 contact card overflow menu

$
0
0
From https://docs.microsoft.com/en-us/previous-versions/office/developer/office-2010/ee909466(v=office.14) I know that the "..." menu on the contact card in Outlook 2010-2016 is idMso="ContextMenuContactCardOverflowDropdown".

This idMso does not exist in any of the documents provided at https://github.com/OfficeDev/office-fluent-ui-command-identifiers.

Outlook 2019 has a different overflow menu with a different id.  I have been searching all day and as yet have been unable to determine the idMso of this menu.  What is it?

We have an addin that will add the appropriate idMso to context menus, but it relies on having a prepared static list of idMso strings to generate customUI xml.

Does there exist some way to inspect the idMso values in UI at runtime, or to programmatically list idMsos for controls without knowing them in advance?

SeriesCollection.NewSeries is only adding 1st series

$
0
0
It's the first time I try to create a chart in Excel with C#. The code below adds a chart and adds "boxSections.Count()" series to the chart. This is working fine but there is one catch. The chart does display the title and has the correct size but doesn't display the bars unless I select the chart, go to "Chart Tools -> Design" and press the "Select Data" button.

The problem I think is with the ".NewSeries()" method. Only the first one is added.
// Create the chart.
var charts = (ChartObjects)sheet.ChartObjects();
var chartObject = charts.Add(0, 0, 500, 100 * valuesArrays.Count);
var chart = chartObject.Chart;
chart.ChartType = XlChartType.xlBarStacked;
chart.ChartWizard(Title: "Box-Whisker Plot", HasLegend: false);
var seriesCollection = ((SeriesCollection)chart.SeriesCollection());

// Add the quartile1s, lowerHalfs and upperHalfs bars to the chart.
for (var i = 0; i < boxSections.Count(); i++)
{
    var series = seriesCollection.NewSeries();
    series.ChartType = XlChartType.xlBarStacked;
    series.Values = boxSections[i];
    series.Format.Fill.Solid();
    series.Format.Fill.Transparency = 1;
}
((Axis)chart.Axes(XlAxisType.xlCategory)).CategoryNames = names;


VSTO file type mapping lost

$
0
0

We are currently running som experiments with Visual Studio 2008 and VSTO 3.0. But when deploying a solution to a client workstation we have encountered a problem with the VSTO file type association. For some reason the file type .vsto was suddenly associated with notepad. An after this we can not correctly use the setup files generated by VS 2008 / VSTO 3.0 on this machine.

 

We hare tried uninstalling and reinstalling Visual Studio Tools for Office Runtime 3.0, but this did not reset the file association for VSTO file types. We have not been able to manually set the association, as we can't find an the appropriate program. The client workstation is running Vista.

 

Could anyone please guide us how to set the .vsto file mapping correctly - either manually or somehow automatically by reinstalling.

 

 

Thanks in advance

Thomas N. Sørensen

Debugger doesn't find word application

$
0
0

Hi!

I moved to a new computer and now I can’t debug my Word VSTAO addin project anymore. The following error message pops up:

Unable to debug Windows Store app ‘#Software\Microsoft\15.0\Word\InstallRoot\Path#Winword.exe’.

The debugger was unable to find the registration for the target application. If the problem persists, try uninstalling and then reinstalling this application.

What I tried so far:

  • Uninstalling and reinstalling both Visual Studio and MS Office
  • Running Visual Studio with admin account
  • Turning on developer mode in Windows.

 

Software versions (64bit)

  • Windows 10 v1903
  • Visual Studio 2019 16.1.5
  • Ms Office 365 business v1906

 

Any help would be highly appreciated.

 

Thanks

Michael

 

 


Viewing all 5157 articles
Browse latest View live


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