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

Outlook PST file extraction

$
0
0
Does anyone know how to open outlook pst files and extract the contents to another format.  For example, a database.

I need to periodically receive pst files, extract the contents from them and store them in a database.

Outlook automation is not the best option because it prompts you to allow anonymous access before letting you process and email.  I would like no use interaction if possible.

Error: Setup has detected that the file 'C:\Users\XXXX\AppData\Local\Temp\VSDF41E.tmp\VSTOR40\vstor40_x64.exe' has either changed since it was initially published or may be corrupt.

$
0
0

I am creating a setup installer for my Outlook Addin following blogs.msdn.com/b/mcsuksoldev/archive/2010/10/01/building-and-deploying-an-outlook-2010-add-in-part-2-of-2.aspx

Prerequisites are :1. Net framework 4.0 client profile

2. VSTO 2010

3. Win installer 3.1

I have a code signing certificate from go daddy. I am signing my setup and Msi as well.

Application installs and loads properly when prerequisites are pre-installed in the system, But when setup tries to download vsto prequisite it shows the error. Following is the error log.

Please help

The following properties have been set:
Property: [AdminUser] = true {boolean}
Property: [InstallMode] = HomeSite {string}
Property: [ProcessorArchitecture] = AMD64 {string}
Property: [VersionNT] = 6.1.1 {version}
Running checks for package 'Windows Installer 3.1', phase BuildList
The following properties have been set for package 'Windows Installer 3.1':
Running checks for command 'WindowsInstaller3_1\WindowsInstaller-KB893803-v2-x86.exe'
Result of running operator 'VersionGreaterThanOrEqualTo' on property 'VersionMsi' and value '3.1': true
Result of checks for command 'WindowsInstaller3_1\WindowsInstaller-KB893803-v2-x86.exe' is 'Bypass'
'Windows Installer 3.1' RunCheck result: No Install Needed
Running checks for package 'Microsoft .NET Framework 4 Client Profile (x86 and x64)', phase BuildList
Reading value 'Version' of registry key 'HKLM\Software\Microsoft\NET Framework Setup\NDP\v4\Client'
Read string value '4.0.30319'
Setting value '4.0.30319 {string}' for property 'DotNet40Client_TargetVersion'
The following properties have been set for package 'Microsoft .NET Framework 4 Client Profile (x86 and x64)':
Property: [DotNet40Client_TargetVersion] = 4.0.30319 {string}
Running checks for command 'DotNetFX40Client\dotNetFx40_Client_x86_x64.exe'
Result of running operator 'ValueEqualTo' on property 'InstallMode' and value 'HomeSite': true
Result of checks for command 'DotNetFX40Client\dotNetFx40_Client_x86_x64.exe' is 'Bypass'
Running checks for command 'DotNetFX40Client\dotNetFx40_Client_setup.exe'
Result of running operator 'ValueNotEqualTo' on property 'InstallMode' and value 'HomeSite': false
Result of running operator 'VersionGreaterThanOrEqualTo' on property 'DotNet40Client_TargetVersion' and value '4.0.30129': true
Result of checks for command 'DotNetFX40Client\dotNetFx40_Client_setup.exe' is 'Bypass'
'Microsoft .NET Framework 4 Client Profile (x86 and x64)' RunCheck result: No Install Needed
Running checks for package 'Microsoft Visual Studio 2010 Tools for Office Runtime (x86 and x64)', phase BuildList
Reading value 'Version' of registry key 'HKLM\SOFTWARE\Microsoft\VSTO Runtime Setup\v4R'
Unable to read registry value
Not setting value for property 'VSTORuntimeVersionInstalled'
The following properties have been set for package 'Microsoft Visual Studio 2010 Tools for Office Runtime (x86 and x64)':
Running checks for command 'VSTOR40\vstor40_x86.exe'
Skipping ByPassIf because Property 'VSTORuntimeVersionInstalled' was not defined
Result of running operator 'ValueNotEqualTo' on property 'ProcessorArchitecture' and value 'Intel': true
Result of checks for command 'VSTOR40\vstor40_x86.exe' is 'Bypass'
Running checks for command 'VSTOR40\vstor40_x64.exe'
Skipping ByPassIf because Property 'VSTORuntimeVersionInstalled' was not defined
Result of running operator 'ValueNotEqualTo' on property 'ProcessorArchitecture' and value 'AMD64': false
Result of running operator 'ValueEqualTo' on property 'AdminUser' and value 'false': false
Result of checks for command 'VSTOR40\vstor40_x64.exe' is 'Install'
'Microsoft Visual Studio 2010 Tools for Office Runtime (x86 and x64)' RunCheck result: Install Needed
EULA for components 'Microsoft Visual Studio 2010 Tools for Office Runtime (x86 and x64)' was accepted.
Copying files to temporary directory "C:\Users\ADMINI~1\AppData\Local\Temp\VSDF41E.tmp\"
Downloading files to "C:\Users\XXXX\AppData\Local\Temp\VSDF41E.tmp\"
(22-02-2016 11:18:42) Downloading 'VSTOR40\vstor40_x64.exe' from 'http://go.microsoft.com/fwlink/?LinkId=158918' to 'C:\Users\XXXX\AppData\Local\Temp\VSDF41E.tmp\'
Download completed at 22-02-2016 11:18:43
Verifying file integrity of C:\Users\XXXX\AppData\Local\Temp\VSDF41E.tmp\VSTOR40\vstor40_x64.exe
Verifying file hash
Error: Setup has detected that the file 'C:\Users\XXXX\AppData\Local\Temp\VSDF41E.tmp\VSTOR40\vstor40_x64.exe' has either changed since it was initially published or may be corrupt.

PowerPoint 2016 - Slides.InsertFromFile method, does not keep Slide's CustomLayout

$
0
0

Hi All,

I am using VSTO for building a PowerPoint Add-On.

With the latest update of PowerPoint 2016, I see that InsertFromFile method on Slide collection is not copying the Slide's CustomLayout. Inserted slide is using the Custom Layout that already exists in the presentation.

I can see that this is working ok with PP2013 and PP2010.

Can someone give me some info about this. Is there some workaround for this?

Thanks

Outlook 2007 RTM FormRegion editing bugs

$
0
0

I am trying to edit FormRegion in the Outlook 2007 that I was developing in B2TR. When trying to modify it (add more controls) the changes are not saved. Even when trying to "Save As" the dialog is never poping up. By trial an error I've discovered that if I delete the TabControl (MultiPage) from my region it will allow to save it. What's going on?

Thx... Alex

Install Error

$
0
0

We're sorry. The following products have failed to install.

Microsoft Office Developer Tools Update 1 for Visual Studio 2015

This product did not install successfully: Downloaded file failed signature verification and may have been tampered with

Web Platform Installer 5.0 Log

Redemption RDOMail Outlook.MailItem.MarkAsTask() equivalent

$
0
0

Hi guys,

Anyone knows what is the equivalent way to flag a mail item, like MarkAsTask() does, using Redemption's RDOMail class?

for example,

Outlook.MailItem item;
//...
item.MarkAsTask(Outlook.OlMarkInterval.olMarkNoDate);

and

RDOMail item;
//...
item.FlagStatus = (int)Outlook.OlFlagStatus.olFlagMarked;

is not producing the same result, and there isn't any MarkAsTask() method in RDOMail class to call.

Same with MailItem.ClearTaskFlag().

Outlook version 2010 and above.

Thanks


Jason Orphanidis

Outlook 2016 Visual Studio 2015: unable to access HTMLBody property

$
0
0

Using Windows 7 x64, I am following the create your first AddIn walkthrough, and am unable to access the mailItem.HTMLBody property in the Inspectors.NewInspector event.  mailItem.Body works fine, however.

View Source shows the HTML markup. But when I  inspect variable mailItemin the Immediate window to look at its HTMLBody property, I get error CS1061:

'MailItem' does not contain a definition for 'HTMLBody' and no extension method 'HTMLBody' accepting a first argument of type 'MailItem' could be found (are you missing a using directive or an assembly reference?)

Is there a using directive, or assembly reference, required in order to be able to examine this property?  




New VSTO project is incompatible when reopened in VS2015

$
0
0

I create an new project based on Excel 2016 or Word 2016 in VS2015 Community.

When I save and reopen I get ExcelWorkbook1 (incompatible)

'This project is incompatible with the current edition'

'You do not have a version of Office that is supported with this version of Visual Studio. Please install Office 2010 or greater then try again.'

I have tried reinstalling everything multiple times. I have this on both Server 2012 and Windows 8.1

I upgraded from Office 2013 + VS 2013 where everything was working fine.

And: when I remove ExcelWorkbook1 from the solution and add again as existing project, project loads fine. Only to find the problem reoccur after saving and closing VS2015.





MICROSOFT EXCEL UPDATES KB3085502 and KB3114504 CAUSING EXCEL ERRORS

$
0
0

Hi,

Our customers are facing issues when they run our reports to Excel when they have the KB3085502 and KB3114504 updates installed. They are getting the following error message:

Office has detected a problem with this file. To help protect your computer this file cannot be opened.' Error for 'Microsoft Excel: '

Above are 2 KBs which are confirmed to create this issue and confirmed to go away if they are un-installed.

Are there any fixes for this issue. If not, can you provide a solution for this? Also, can we make sure that future updates won't cause such issues?

Thanks,

Vishal

Outlook 2016 PIA

$
0
0
Hi,

We have outlook add-in which works fine in Outlook 2007 /2010 & 2013 without any issues. Now we are trying to extend outlook add-in support to Outlook 2016, during this process of migration we are facing issues in compatibility checking.we needcomponent Id of Outlook PIA 2016 on both x86 and x64 version and office 2016 shared PIA.

Could you help me in getting the component Id of Outlook PIA 2016 on both x86 and x64 version?
Sample code for 2010:

      strCheckPath += "\\MyVrmAddin\\ComponentCheck.exe";
            int iCode = CheckComponent("{1D844339-3DAE-413E-BC13-62D6A52816B2}", strCheckPath);
            if (iCode == 0)
                iCode = CheckComponent("{64E2917E-AA13-4CA4-BFFE-EA6EDA3AFCB4}", strCheckPath);
            if (iCode == 0)
                 b2010PIAExists = true;

     <Property Id="COMPONENTEXISTS_OUTLOOK2010_X86" Secure="yes">
        <ComponentSearch Id="ComponentExistsOutlook2010x86" Guid="CFF13DD8-6EF2-49EB-B265-E3BFC6501C1D"/>
      </Property>

     <Property Id="COMPONENTEXISTS_OUTLOOK2010_X64" Secure="yes">
        <ComponentSearch Id="ComponentExistsOutlook2010x64" Guid="ECCC8A38-7855-46CA-88FB-3BAA7CD95E56"/>
      </Property>

Thank you,
Elakkiya.




convert ADD-IN VSTO Outlook to msi

$
0
0

Hello
I got ADD-IN for Outlook Extension VSTO file,

   and I'm looking for a way to distribute it to workstations and thought maybe the .msi file conversion - Is there a simple guide to doing it? Without going into programming
Thanks


אם תגובתי פתרה את בעייתך - לחץ/י, על &quot;סמן כתשובה&quot; ליד סימן ה V הירוק.


Highlighting a Range of Text at Various Positions in Word

$
0
0

I have a bookmark control that contains some text content. I want to highlight portions of that text, but not all of it. Range.HighlightColorIndex only highlights the entire specified range, so it's not useful for my purposes. I've tried defining new ranges and highlighting them separately, but then I run into issues with overwriting other bookmark controls in the document. Is there a way to do this without messing with other content in the document?

I am working in C#.

Add own customs save location (place) to Word 2013

$
0
0
Can a plugin for Word 2013, add a new location or place (like Dropbox, OneDrive).
Want to make a new option available when the user wants to save their document. So instead of selecting Onedrive, they can save to another system, and is showed a customize save dialog.

Convert VBA add-in to VSTO

$
0
0

Hi,

 

I am using Word 2010 and Visual Studioa 2010.

I have a Word 2010 add-in. My add-in has 6 user forms, class modules, code modules and so on. I would like to migrate this add-in to .Net/VSTO and VB .Net. I want to use task panes and etc which is not directly available from VBA.

Could you please guide me in some direction, starting point. I have used VS to create Windows Forms applications. I would like to know how do I migrate my code base to VSTO? Is there an automatic converter available?

Thanks.

I have a Outlook AddIn which displays a yearly calendar how can i add to the ribbon

$
0
0

I have a Outlook AddIn which displays a yearly calendar how can i add to the ribbon.

I use a german Office 2013 32 bit on a Windows 10 64 bit machine. I use Visual Studio 2015 Community and the actual version of vsto.

The AddIn uses WPF and i added it to the start ribbon at the right in a new group in all calendar explorers.

I would like to modify the existing Ribbon group and place it right beside the "monthly" button. If this is not possible, i like to put my group right beside the group containing the "montly" button.

What i have:

<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
  <ribbon>
    <tabs>
      <tab idMso="TabCalendar">
        <group id="GroupCalendarArrange" >
          <button id="textButton" label="Insert Text"
             screentip="Text"
             supertip="Inserts text at the cursor location."
                  onAction="OnTextButtonClicked"
                  />
        </group>
      </tab>   
    </tabs>
  </ribbon>
</customUI>

-----------

public string GetCustomUI(string ribbonID) {
            if (ribbonID == "Microsoft.Outlook.Explorer")
                return GetResourceText("YCAddIn.RibbonXml1.xml");
            return null;
        }

public void OnTextButtonClicked(Office.IRibbonControl control) {
            MessageBox.Show("You clicked " + control.Id);
        }

------

I have the Excel Sheets regarding "Office 2010 Developer Resources" and played with things like AfterOfficeId="GroupCalendarArrange", without having success.

Anyone a hint!?

Best Regards

     Winfried Wille

E-Mail: ww@w2ww.de


Unable to cast COM object of Office Interop Word

$
0
0

I got this error after update office from 2010 to 2013

Here is the reference i used

Here is the code

Microsoft.Office.Interop.Word.Application appVersion = new Microsoft.Office.Interop.Word.Application();
appVersion.Visible = false;

and this is the error message:

Unable to cast COM object of type 'Microsoft.Office.Interop.Word.ApplicationClass' to interface type 'Microsoft.Office.Interop.Word._Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{00020970-0000-0000-C000-000000000046}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

I try to check {00020970-0000-0000-C000-000000000046} in registry but can't find anything.

Please help. Thanks

TotalRow in ListObject does not refresh after change

$
0
0

Hi,

My listObject binds to my ViewModel. Also, I set option for my list object to show TotalRow using following statement

inputTable.ShowTotals = true;
After I change value in my listobject TotalRow does not refresh. Then I added handler to handle ListObject change events as follows:

inputTable.Change += new Microsoft.Office.Tools.Excel.ListObjectChangeHandler(list1_Change);

And the list1_Change method looks as follows:

 void list1_Change(Microsoft.Office.Interop.Excel.Range targetRange,
            Microsoft.Office.Tools.Excel.ListRanges changedRanges)
        {

            if (_selectedArea == "Opex")
            {
                Globals.ThisWorkbook.Application.ScreenUpdating = false;
                Globals.ThisWorkbook.Application.EnableEvents = false;
                Globals.ThisWorkbook.Application.EnableAutoComplete = false;
                    inputTable.ShowTotals = false;
                    inputTable.ShowTotals = true;
                Globals.ThisWorkbook.Application.EnableEvents = true;
                Globals.ThisWorkbook.Application.EnableAutoComplete = true;
                Globals.ThisWorkbook.Application.ScreenUpdating = true;
            }

        }

It works Ok but if I change 500 cell rows in one column in my listObject at once (using copy/paste option) it takes a lot  of time to refresh TotalRow because it is done for each row separately instead for all rows at once. :(?

can anyone help me to make this as it should be..to refresh totalrow instantly after any change .

Thanks in advance

Almir


 

POP Outlook

$
0
0
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Outlook = Microsoft.Office.Interop.Outlook;

namespace OutlookMail
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {

        }

        private void btnSend_Click(object sender, EventArgs e)
        {
            try
            {
                Outlook._Application _app = new Outlook.Application();
                Outlook.MailItem mail = (Outlook.MailItem)_app.CreateItem(Outlook.OlItemType.olMailItem);
                mail.To = TextTo.Text;
                mail.Subject = TextSubjet.Text;
                mail.Body = TextMessage.Text;
                mail.Importance = Outlook.OlImportance.olImportanceNormal;
                ((Outlook._MailItem)mail).Send();
                MessageBox.Show("Sucesso","Message",MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex) {

                MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

        }
        DataTable dt;
        private void btnRecieve_Click(object sender, EventArgs e)
        {
      
           try { 
                Outlook.Application _app = new Outlook.Application();
                Outlook._NameSpace _ns = _app.GetNamespace("MAPI");
                Outlook.MAPIFolder inbox = _ns.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox);
                _ns.SendAndReceive(true);
                dt = new DataTable("Inbox");
                dt.Columns.Add("Subject", typeof(string));
                dt.Columns.Add("Sender", typeof(string));
                dt.Columns.Add("Body", typeof(string));
                dt.Columns.Add("Date", typeof(string));
                dataGridView.DataSource = dt;
                foreach (Outlook.MailItem item in inbox.Items)
                    dt.Rows.Add(new object[] { item.Subject, item.SenderName, item.HTMLBody, item.SentOn.ToLongDateString() + " " + item.SentOn.ToLongTimeString() });
           }
           catch (Exception ex)
           { MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Error); }
        }

        private void dataGridView_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < dt.Rows.Count && e.RowIndex >= 0)
                webBrowser.DocumentText = dt.Rows[e.RowIndex]["Body"].ToString();
        }
    }
}

Erro:

Não é possível associar o objecto COM do tipo 'System.__ComObject' ao tipo de interface 'Microsoft.Office.Interop.Outlook.MailItem'. Esta operação falhou porque a chamada QueryInterface no componente COM para a interface com o IID '{00063034-0000-0000-C000-000000000046}' falhou com o seguinte erro: Esta interface não é suportada (Excepção de HRESULT: 0x80004002 (E_NOINTERFACE)).

VSTO and Sharepoint Credentials

$
0
0

I can't find anything in the Office Object Models that refers to accessing SharePoint Credentials stored by Office Programs such as Word for opening and saving files to SharePoint Online.

I am curious if I have missed something here. 

In the alternative, is there a VSTO mechanism available to allow storing ADAL credentials in the Windows Credential Vault just as Word does?


Jeff Childers

HKLM entry for Excel VSTO not working

$
0
0









I have been deploying an Excel add-in developed in VS 2010 for Excel 2010, for over six years, on over 300 machines. All machines are Win7 64 bit. I add the registry keys to HKLM\Software\Wow6432Node\Microsoft\Office\Excel\Addins.  Up to now, I haven't had an issue installing onto new machines.

  We aquired another company and have been deploying the add-in.  Again all Win7, 64 bit.  Three machines out of thirty had the same Isuue.  They wouldn't run with the HKLM key entry.  If fact, Windows Installer won't make the entry, I have had to entry it manually, even then, it would not work. The add-in only runs when the add-in key entries are made in HKEY_Current User\Software\Microsoft\Office\Excel\Addins.  The machines having the problem are fairly new, never had anything less than Office 2010 on them. All users have administrative priviledge.  The addin program itself loads into Program Files(86).  I've read the articles Deploying your VSTO add-ins to All Users and Registrt Entries for Application=Level Add-ins.  The only issue mentioned is the need of fix 976477 which seems to only have to do with Office 2007.               What could be causing this issue ?      Thanks


Viewing all 5157 articles
Browse latest View live


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