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

This document might not function as expected because the following control is missing: Sheet1.

$
0
0

I'm developing a Excel 2010 Document Level Customization Application using Visual Studio 2010 SP1.

When the Macro Setting is Checked in Trust Center : Macro Settings -> Trust access to VBA project Object Model

My application works fine without any exceptions.

When the Macro Setting is unchecked in Trust Center : Macro Settings -> Trust access to VBA project Object Model

I get the following error :

This document might not function as expected because the following control is missing: Sheet1. Data that relies on this control will not be automatically displayed or updated, and other custom functionality will not be available. Contact your administrator or the author of this document for further assistance.

How to address this problem?


Translate Excel numberformat property into VB.net to populate a visio label

$
0
0

I'm developing VSTO programs for both Excel and Visio.  I store a numberformat from a cell in Excel, and then I want to apply that number format to numbers that I display both on a Windows form and in a Visio diagram.

Is there an easy way to translate Excel's numberformat property (i.e., 0.00, 0%, DD/MM/YYYY) into VB.Net terms?  Like to display a formatted number on a Window's form, or a formatted number in a shape's text in Visio?


Gina

Outlook Add-In that uses public folders and Exchange Online scenario

$
0
0

Hi,

I 'd like to know whether a VSTO add-in for Outlook (2007, 2010, 2013) that uses Exchange Server's public folders to do its work, will still be able to work (reference public folders, send emails, fire events etc. the same way as before) in an Exchange Online scenario, where the user mailbox and public folder store is on the cloud.

Does anyone have any experience / knowledge on this?

Thank you in advance,

Jason Orphanidis


Jason Orphanidis

Office add-in that works in Win 7 doesn't work in Win 8

$
0
0

Are Office add-ins that work fine in Win 7 suppose to work in Win 8? Because mine doesn't.

Joel

range.interior.color , how to set from a html color code

$
0
0
hello all,

I get the color code from the server as a string and i need to convert the color code into Excel's color.

for ex. I get the color code from server as ""#ffff99". ( this value is not a constant and it can be different ).

How do I convert "#ffff99" to excel's known color? my project is in c# and I have tried the following and I do see some colors but the color doesn't match with the html color code. Could you please help? thanks

col1 = System.Drawing.ColorTranslator.FromHtml(style.backgroundColor);
rng.Interior.Color = col1.ToArgb();
kris

"The Operation Failed" error on Task and Appointment Close Method

$
0
0

We have an Outlook VSTO add-in that is used by about 50 users.  It syncs tasks and appointments between our application and Outlook.  It works great for all by one user.  For one user, it throws a "The Operation Failed" error on the Close(Save) method for all of the tasks and all of the appointments.  Another user at the site is able to use his account and Outlook profile successfully with the add-in on the same computer.  We are able sync this user's information with our own Outlook profiles and it works, so there seems to be an issue with the user's Outlook profile/.pst file.

Basic code:

Outlook.TaskItem t = null; 
t=Application.CreateItem(Outlook.OlItemType.olTaskItem);

/*...sets Status, Date, Subject, Body, Work, Category, Importance, User properties...*/

try{
    ((Outlook._TaskItem)t).Close(Outlook.OlInspectorClose.olSave); 

} catch (Exception ex) 
{      
    //ex.Message="The Operation Failed."
}

/*... goes to clean up code ...*/

My first thought was that maybe she had reached some max size on her profile, but she can create and save a Task in Outlook directly so the saving seems to only be an issue within the add-in.

When I looked for this "The operation failed." error I found all sorts of support on it for hundreds of different reasons.  I was able to verify that there are no special characters at play and also I don't think her profile is corrupted as it does work fine outside of the add-in.  I also had them reinstall the add-in and restart the computer.  I am lost on what else I should try to resolve the issue. 


Cindy

Disable ReviewTrackChanges button in ms word 2010 ribbon.

$
0
0

Im trying to disable track change toggle button in ribbon of ms word 2010.


Here is my ribbon.xml

<?xml version="1.0" encoding="UTF-8"?><customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui><ribbon><tabs><tab idMso="TabReviewWord"><group idMso="GroupChangesTracking"><toggleButton idMso="ReviewTrackChanges" getEnabled="GetEnabled"/></group></tab></tabs></ribbon></customUI>

Get Enabled function is never called. Any ideas why??


Create multipleTabs

$
0
0

I am developing an addin for MSProject, I want to create multiple tabs as one tab is not sufficient to hold many controls.

can any one help me.

Thanks in advance

Rameshchandra C Keni (PMP)


RCKeni


Replace Barcode Font with vb.net

$
0
0

Hello,

I'm an Italian Developer.

I have one Microsoft Word File and I need to Replace «Code» string to Barcode 39 or 128 with MICROSOFT WORD'S OBJECT MODEL in vb.net.

I'm using this font http://www.barcodesinc.com/free-barcode-font/free3of9.zip or http://www.idautomation.com/free-barcode-products/code39-font/#Download_Free_Barcode_Font

I notice that « (ASCII 171) and » (ASCII 187) symbols are not supported (http://www.yellowpipe.com/yis/tools/ASCII-HTML-Characters/).

For example:

- I write «Code» string on word file
- I underline all string and I change font to Code39 Barcode
- I view that "Code" string change in Barcode format but not « and »
- With Vb.net, I replace «Code» string in vb6 to "2014.001" and result on word file is 2014.001 in TIMES NEW ROMAN and not in Barcode font.

I understand that the problem are 2 symbols

There is one way?



Thanks!

Fabio


Getting ClickOnce setup.exe path in runtime

$
0
0

Hi,

I'm writing a Word AddIn in VSTO using C#.

My question:

Is there a way to get in runtime the path from where the AddIn installed?

For example, the ClickOnce setup.exe is located at:

C:\MyAddIn\setup.exe

So I want to get the path: C:\MyAddIn

I tried looking in the vsto manifest but I couldn't find this information.

I know if I try to update the version of the AddIn from another location, I will get an error message saying it was installed from other location. So I guess this information is somehow accessible.

Why do I need this? (Maybe you can suggest other approaches)

I disabled automatic updates and manage a manual update mechanism, so whenever user clicks a button on the ribbon, it will launch thesetup.exe from the publish location (let's say: N:\MyAddIn)

Now, this shared folder is also accessible via UNC, say: \\shared\\MyAddIn

So If a user installes the AddIn from \\shared\\MyAddIn, and then uses the updater which launches thesetup.exe from N:\MyAddIn then he will receive an error saying it was installed from different location. 

So my idea is when the AddIn first loads (only once, after installation) to detect the actual path where thesetup.exe ran from, and the updater will use this path, and not the hardcoded one.

Installation/dependencies for Powerpoint AddIn

$
0
0

We have recently enhanced our ActiveX Plugin with an Add-In that allows users to use our ActiveX plugin without using the Developer Tab (see http://social.technet.microsoft.com/Forums/office/en-US/4e36ea4d-2653-4f33-9d6a-b677ae8fe635/adding-a-activex-plugin-to-powerpoint-without-using-the-developer-tab?forum=officegeneral)

I have been having a very difficult time creating an installation bundle that includes all of its dependencies.  First, I install .NET 4 if the user hasn't installed it, then I install the Visual Studio 2010 Tools for Office Runtime (http://www.microsoft.com/en-us/download/details.aspx?id=40790), and then my ActiveX Plugin and AddIn.  This seems to work on most computers, however, we are still getting complaints that the AddIn doesn't get installed on some computers.  My Question: are there any other dependencies that I need to install to make sure that the AddIn can be used properly?  Some things that come to mind are: the Office PIA or the MVC++ 2010 redistributables, but I do not see documentation that tells me what the actual dependencies are.  If anyone knows, or can point me to the correct answer, please let me know.

Thanks in advance!

Blaine


Blaine Bell

Webbrowser control in Word 2010 hanging parent window when opening new links

$
0
0

Hi,

First off, I am VERY new in developing add-ins and code for Office using Visual Studio, so if i need any more info please let me know.

I have a Word Add-In that displays a custom task pane with a Web Browser control, that is set to go to a sharepoint site. This site hosts a number of Office 2010 templates. The webbrowser control loads the page fine, however when a template is launched, it launches in an entirely new instance of Word 2010 and causes the initial window to stop responding.
If I enable context menus in the web browser, and right click a link to select open, it opens the template within the same instance of word and everything is fine.

I need to understand what could possibly be locking the initial instance of word, or how to intercept the link click and open a document that way.

FYI - the new window that gets loaded does not trigger any of the webbrowser events such as navigated, navigating or even document complete.

There is next to no code, this is a very simple example that has got me stumped. There is just the addition of the custom task pane.

Ribbon.CS:

 

 

 

 

 

 

private void button1_Click(object sender, RibbonControlEventArgs e)
{

UserControl1 myBMS = new UserControl1();
CustomTaskPane myBMSTaskPane = Globals.ThisAddIn.CustomTaskPanes.Add(myBMS, "Templates");
myBMSTaskPane.Width = 350;
myBMSTaskPane.Visible = true;

}

 Any ideas or pointers would be greatly appreciated. Thanks!

 

Current User Add-in loadbehavior can override Local Machine settings

$
0
0

Outlook 2010 32-bit, Win7 64-bit.

Hi,

All of the documentation regarding the installation options for COM Add-ins conflicts with what I am seeing for existing Add-ins.

All add-ins with the exception of my new VSTO Add-in can be disabled by the user (non admin) and they remain disabled.  Yet they are all registered in the HKLM.  When disabling, a Current User reg key is created and the load behavior of "2" overrides the HKLM loadbehavior value of "3".  This is what I would like to mimic with my Add-in. 

i.e. install it for all users, yet allow all users to disable and keep it disabled upon Outlook restart. 

Example: OneNote.OutlookAddin.  It is only showing in HKLM...wow6432Node\...Outlook\Addins.  Yet when I disable it, an HKCU key is created and its value overrides the HKLM value.

Again, I would like to mimic this so any new user receives the add-in and can disable it, but I have been unable to.

Thanks

Need to disable Outlook native "New Item" functionality for custom form region named "IPM.Contact.SBL.Account" which has been created from Outlook's native Contact form.

$
0
0

Hi,

I am new to VSTO and looking to create a MS Outlook Add In to disable Outlook's native "New Item" button from its native ribbon for a custom form region which has been created using outlook's standard contact form.

Could you please provide me with a sample code and event handler for creating new item in Outlook.  We have a requirement to restrict creation of new items of custom form type in Outlook.

Need urgent help.

Thanks,

Abhinav

Parent word document freezes when word document is produced from its addin

$
0
0

I have a word add in where it loads the web browser dialog which connects to share point site, from there i can select the custom templates which we have to create a word document. after it creates new word document it should close the dialog instead it is freezing the dialog also the parent word documents stops responding. The same behavior works well in IE and other addins(excel, powerpoint and outlook).

function SI_BIF_ProduceFile(strFileUrl) {
 debugger;
   var obj = new ActiveXObject('SharePoint.OpenDocuments.3');
   obj.EditDocument(strFileUrl);
}

The above is the code which generates the word document.

If anyone has any idea please suggest, looks like a know issue but i didn't find any solution yet.

Thanks in advance.


How to use icons in custom menu tab in Outlook?

$
0
0

We have developed an Outlook addin which has a custom menu tab in the main Outlook Explorer window (CommandBarPopup). This has several menu items (CommandBarButton). We would like to have icons corresponding to each of these CommandBarButton-s. Accordingly, we have created 16 X 16 ico images. We convert these to IPictureDisp objects to be able to set them to the "Picture" property of the CommandBarButton-s. We are forced to do this because according to the page "http://blogs.msdn.com/b/rgregg/archive/2006/11/27/converting-bitmaps-to-ipicturedisp.aspx", ---  Unfortunately, Outlook doesn't handle the managed code types System.Drawing.Bitmap and System.Drawing.Icon so you need to find some way to convert these types into  IPictureDisp ---

We are facing the following problem:

The original images created have transparent backgrounds, but after conversion, the transparency is lost. As a result, there is a disparity in the background of the icon and the menu pane

How we use icons on the custom menu tab in the main Outlook Explorer window without losing its transparency or getting distorted?

 

Cannot open Word document after publishing (Office.Interop.Word)

$
0
0

I cannot open Word documentin c# after publishing to IIS

It can open Word document and replace any text in debug mode by using Microsoft.Interop.Office.Word. When I publish the project, it return the following error:

object reference not set to an instance of an object

Here is my code:

try {

Microsoft.Office.Interop.Word.Application wordApp = new Microsoft.Office.Interop.Word.Application { Visible = true };

Microsoft.Office.Interop.Word.Document doc = wordApp.Documents.Open(ref fileName, ReadOnly: false, Visible: true);

doc.Activate();

..

}

The file path is correct. I found that the doc object returns null value.

Working environment:

- Windows Server 2012
- Visual Studio Professional 2012
- .Net framework 3.5
- Microsoft Word 2007

I try to add IUSR account and set enough permission to the folder which contains Word documents. It stills return the same error message. But it can work properly in debug mode...

Thanks for your help


Black stripes on CustomTaskPanes when closing Excel

$
0
0

if an event Application_WorkbookDeactivate hide office panel they shimmer black.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using Excel = Microsoft.Office.Interop.Excel;
using Office = Microsoft.Office.Core;
using Microsoft.Office.Tools.Excel;
using System.Windows.Forms;

namespace ExcelAddIn1
{
    public partial class ThisAddIn
    {
        private UserControl myUserControl1;
        private Microsoft.Office.Tools.CustomTaskPane myCustomTaskPane;
        private Microsoft.Office.Tools.CustomTaskPane myCustomTaskPane2;

        private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
            myUserControl1 = new UserControl();
            myCustomTaskPane = this.CustomTaskPanes.Add(myUserControl1,"My Task Pane");
            myCustomTaskPane2 = this.CustomTaskPanes.Add(myUserControl1,"My Task Pane");
            myCustomTaskPane2.DockPosition = Office.MsoCTPDockPosition.msoCTPDockPositionBottom;
            myCustomTaskPane2.Visible = true;
            myCustomTaskPane.Visible = true;

            Application.WorkbookDeactivate += Application_WorkbookDeactivate;
        }

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

        private void Application_WorkbookDeactivate(Microsoft.Office.Interop.Excel.Workbook Wb)
        {
            myCustomTaskPane.Visible = false;
            myCustomTaskPane2.Visible = false;
        }

        #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
    }
}

VSTO Word 2010 Add-in delete custom control when track changes is on failed. Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

$
0
0

Hello,

We are developing Word 2010 Add-in. The addint adds some costom WinForms controls in VSTO Document.Controls collection. In general those controls provide UI to guide the user during document editing.

In general workflow is as follow: 

1. The Add-in adds custom WinForms controls inside document content via Word.Tools.Document.Controls.Add method.

2. At some point user clicks on button on WinForms controls and Add-in removes the same control from document content.

3. If needed the steps 1 and 2 are repeated for other paragraphs.

Everything works fine except we face really strange exception. Before step 2 (user moves to next control) if users turn on Track Changes, Word.Tools.Document.Controls.Delete throws exception System.UnauthorizedAccessException

System.UnauthorizedAccessException occurred
  HResult=-2147024891
  Message=Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
  Source=""
  StackTrace:
       at Microsoft.Office.Interop.Word.Shape.Delete()
       at Microsoft.Office.Tools.Word.ControlCollectionImpl.DestroyWrapper(String cookie)
  InnerException: 

The strange thing is that if Track Changes have been turned on before step 1. Everything works just fine. Only when Track Changes is turned on between steps 1 and 2 it throws exception.

What can be the reason for this issue?

Best Regards

Veselin

Issue of On Behalfof sender email address.

$
0
0

Hi all,

i am working on outlook.mailitem related funtionality. please any one suggest how to get on behalf of sender email address functionality... 

thanks in advance

Balu.

Viewing all 5157 articles
Browse latest View live


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