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

Cannot run "Data Content Controls with Word (Visual Studio 2012)" sample

$
0
0
I've downloaded and built the application example called Data Content Controls with Word (Visual Studio 2012). But I cannot see controls like they are shown:


And what I actually I see(just Word document without button, TextBox(DocumentActions)):


Guys, does anybody know what I am doing wrong? I would like to see Buttons and TextBox.

I am not getting mouse up event in word 2016 on cell drag in table

$
0
0
Mouseup event is not received on cell Drag in Table drawn in word 2016.. same is available in word 2013?

MailMerge OpenDataSource Error

$
0
0

Hello, we have a windows service that does the mail merge from SQL to word. It was working perfectly when it ran on windows server 2003 R2 (32bit) with Office 2007. We tried bringing the service to windows server 2012 R2 (64bit) and using Office 2013 - but the service keeps crashing with the following error "Object reference not set to an instance of an object" when it runs this line of code:

wordMailMerge.OpenDataSource(Name:="" _,Connection:="DSN=MailMerge" _,SQLStatement:="EXEC dbo.uspGetPrintBatchMergeData {0}" _,SubType:=WdMergeSubType.wdMergeSubTypeOther)

I installed the interop word dll for all version of office since 2007 and I tried using different word interop dll with no luck. The windows service user has admin rights on the server. I can see  a word instance being created in task manager but it just hangs and use up resources. Also I tried compiling my windows service targeting x86 and x64 but that also didn't change anything. I ran the same service on my box (windows 8.1 64bit with office 2013) and it worked.

I would appreciate any help!

Thanks,
Patrick

vsto add-in not in add/remove programs

$
0
0
We have a user running XP that has a VSTO add-in deployed. However, it is not present in add/remove programs and I need to uninstall it and do a full reinstall. How do you manually uninstall a VSTO application?

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.




Com Add in does not appear in Excel

$
0
0

Hi ,

      I am using Excel add in as Presentation Layer. But Business Layer , Data Access Layer and Entity framework is using with C#(web). During my development time, the excel add in tab and COM add in is appearing in excel file. But after I have created setup file installer and installed on the user machine, the excel com add in doesnot appear in excel option > add in side. May I know why COM add in is not appearing and I am really urgent to solve this issue, kindly help to reply me.

       I've done all the steps to create setup file according to the following link:https://msdn.microsoft.com/en-us/library/cc442767.aspx . The setup file is successfully created and able to install at user computer, as well as the application folder path  and necessary registry keys are properly added, just that the COM add in is not appear in Excel add in and also not able to add manually. When I add manually add COM add in (.dll) file, there is a error message that " ##.dll" is not a valid office add in.

         May I know how can I solve this issue?

Thanks,

SY

Where can I get a certificate to sign my VSTO outlook addin?

$
0
0
I have a VSTO outlook add-in that I want to publish. When I install the vsto, Windows 10 says that the publisher is not trusted. To avoid this prompt, I know I might have to buy a certificate and sign my VSTO.

Visual Studio can generate Temporary certificate which is for development purpose, but not production, and is therefore not a trusted certificate.

My question is, where can I apply a trusted certificate? Is is OK from here?

https://www.comodo.com/e-commerce/code-signing/code-signing-certificate.php?key5sk0=2128&key5sk1=3495ec828039acf3e9b52f3c6a5284357b836811



My VSTO calls 3rd party SDK (by adding dll references), I am also wondering: is it enough to only sign my VSTO? or does the SDK also need to be signed?


Signing the .vsto with a certificate which is protected by a password

$
0
0

I'm creating an Add-In for Outlook and want to sign my project (the .vsto-file) with a certificate.

For that I use "Sign the ClickOnce manifests" in the properties of the project in Visual Studio 2015. With choosing "Select from File..." I can select my .pfx certificate. It's password protected, so a dialog will open asking for the password. All this works fine! I can build my project and my .vsto-file is signed with my certificate.

The problem is in building my project using TFS 2015. I get following error:

C:\Program Files (x86)\MSBuild\14.0\bin\amd64\Microsoft.Common.CurrentVersion.targets (2883, 0)

Unable to find code signing certificate in the current user’s Windows certificate store. To correct this, either disable signing of the ClickOnce manifest or install the certificate into the certificate store.

C:\Program Files (x86)\MSBuild\14.0\bin\amd64\Microsoft.Common.CurrentVersion.targets (2883, 0)
Cannot import the following key file: . The key file may be password protected. To correct this, try to import the certificate again or import the certificate manually into the current user’s personal certificate store.

I already installed the certificate on the TFS (on local machine) by double-clicking it. But it doesn't solve my problem...

I already tried to installed Windows SDK 7.1 (like recommended in another post). Actually we have SDK 8 on TFS. With tryin to install SDK 7.1, I got the error, that I have just a pre-release version of .NET 4.0 installed. So I tried to install .NET 4.0, but I got the error, that this version is already installed...

I already tried to use "Sign the assembly" with choosing a strong name key file in Visual Studio. But I got the error, that the certificate and the private key cannot be found for the decryption...

I already tried using a certificate without a password. This works fine with building on the TFS. But this is no solution in my case...

I would be so thankful to get help :)




How do I get out of a file in protected view?

$
0
0
How do I get out of a file in protected view?

How to insert data into "placeholders" of a Word document?

$
0
0

Guys, I've read this article and I am amazed by opportunities of VSTO. It is really cool. Now I want to create some user controls(WPF) and insert data to a Word document at the specific places like that:

I will have three WPF TextBox'es corresponding to placeHolder_* and a button which will read data from TextBox'es and insert text into placeholders. What code should I write to achieve this?

Any help such as example, tutorials which will be greatly appreciated!:) 

there is no gallery item selectionchanged evenet ,why?

$
0
0

hi folks,

i want to add a gallery in my ribbon. i added som items but when it came to handle the events, i couldnt find any selectionchanged event. there is only click event.

am i doing something wrong?


Dig your well before you are thirsty

How to "take" current page and put data into bookmark?

$
0
0

I've managed to create and show in "Word.dotx" file an ActionPaneControl. Now I am trying to get bookmarks from the "Word.dotx" file from code-behind ActionPaneControl.What I call bookmarks are just strings in the quotes("bookmark1", "bookmark2", "bookmark3"):

Hello, World!  "Bookmark1" is trying to improve his coding skill in VSTO. He like playing "bookmark2", moreover he likes spending time reading books. For example, "bookmark3"  and it is the favourite book of "Bookmark1".

My question is how can I get bookmarks and replace text from codebehind of ActionPaneControl?

I've tried this code, but I even compile it:

        private void button1_Click(object sender, EventArgs e)
        {
            Document vstoDocument = Globals.Factory.GetVstoObject(this.Application.ActiveDocument);
        }
and error message says:

Error 1 'MyAppl.ActionPaneControl' does not contain a definition for
'Application' and no extension method 'Application' accepting a first argument of type 'MyAppl.ActionPaneControl'' could be found (are you missing a using directive or an assembly reference?)

After resetting cache, Office.Initialize and $ready are not called

$
0
0

Office 2016 Project VSTO

I am publishing an add-in to a test server. The first time the add-in is loaded, nothing happens. I've traced this to Office.initialize. I've waited for a response for 20 minutes before but it was still on the same initial screen. If I hit refresh once even after 1 second, it refreshes and continues like it should.

I thought I had a workaround for it using $.ready(), but not even $.ready() gets called the first time.

If the add-in is refreshed even once, it loads fine until the cache is reset.

I've also tried:

  1. Navigating from Initial.html (a fake starting page as just a jumping off point) to App.html- same issue. It navigates from Initial -> App (via body onload) but not through jQuery, and App still doesn't initiate.
  2. Using ASPX pages instead of HTML pages - Same issue
  3. Cutting down total .html pages - Out of desperation / same issue
  4. Making a 1 page addin - Nothing is called still
  5. $.ready refreshing the page - Worked initially, but once tried on other computers it failed
  6. Adding all scripts to the end of the DOM - No difference

I've had this issue for a month or so and I haven't gotten any closer to solving it.

As with most things, it's far from preferable to add a message that says 'Hey you, if you wanna see something awesome hit refresh!'

Does anyone have any suggestions on how to fix this? Has anyone ever even encountered this?

Thanks

How do I activate the Word window

$
0
0

I have a VSTO addin that opens a custom dialog form.

[Edit: Windows 7, Office 2010, Visual Studio 2015.]

When I open the form from a Toolbar (in a test function) it works well; the form opens, gets the focus, the user clicks a button, focus come back to Word, and the user can continue to type.

But when I open the form from a keyscanning code I have running (hooked to WH_KEYBOARD), focus is not restored to the Word document when the form closes. The user has to click in the Word name list to start typing.

That is weird in itself since the call to open the form is made in exactly the same way, with the exact same arguments, and if anyone has a suggestion for that issue it would interesting to hear that as well. But I digress - back to the issue at hand.

I've been trying to fix the issue by activating the Word window with

Globals.ThisAddIn.Application.Activate()

, but it makes no difference. In a way I understand that, because the window name listlooks like the application is already active. On the other hand, it works if the user manually clicks the name list - does that do anything else except activate Word?

I have tried adding

Globals.ThisAddIn.Application.Documents(1).Activate()

as well (yes, I realize Documents(1) is not a longterm solution but in testing I only have one document open) but it makes no difference.

After googling a bit, I've found the advice to use DoEvents, so I've tried adding

System.Windows.Forms.Application.DoEvents()

with no luck. Do I need to activate the application and/or document window differently? Set focus to something?

[Edit: Oh yeah, this question is kind of a duplicate of https://social.msdn.microsoft.com/Forums/office/en-US/62d03be0-f4f5-49eb-9da2-63a8bd1b2a3f/how-do-i-make-the-word-window-active?forum=worddev#cdc371c1-be3a-4d01-9ca3-105677efb6b6 but that never got resolved, so...]

Show / hide a ribbon depending on active workbook

$
0
0

How do I show / hide a VSTO add-in Ribbon depending on what workbook is active? So I have an add-in that a user needs only when certain xlsx-file is activated and when not, I want to hide the add-in (at least the ribbon part of it).

If I can select, I'd like the answer in VB.Net, but I can manage with C# too.


How to get paragraph range where the cursor is currently active

$
0
0
How can I get the range of paragraph where the cursor is currently active on?

selam alazar simachew

Minimum VSTO runtime version targeting the .NET 4.5.2 Framework

$
0
0

Hi,

I am developing an Outlook Add-in using c# on .NET 4.5.2. I wanted to know what is the minimum version of the VSTO runtime that is needed, which will work on .NET 4.5.2.

I know there are many versions under VSTO 4.0, but i need the exact minimum version like 10.0.40820 or 10.0.60724 etc. Is there any page or wiki where I can have a look at all the VSTO runtimes released till date? That would be great.

Regards, Kiran

Activiating a Ribbon tab for VSTO for a Workbook solutions when a workbook is loaded, .Net 4

$
0
0

Hello all,

I'm trying to a activate a custom RibbonTab when a workbook is loaded.  Below is the code which I am using:

private void myRibbon_Load(object sender, RibbonUIEventArgs e)
{
     this.RibbonUI.ActivateTab("tabCustom");
}

However, I get the error "Value does not fall within expected range."

What am I doing wrong? Please advise if there is an alternate option of doing this.

Thanks,


Vishal Trivedi http://blog.vishaltrivedi.com/

Can we show custom status on status bar in Outlook 2010 ?

$
0
0

I am developing an outlook add in which syncs mails to other server.

I need to display status i.e how many mails have been synced to server, on status bar.

Is it possible to do?

If yes then please show me the ways..

Hide Workbook Ribbon on Load

$
0
0
I created a workbook ribbon tab using the Ribbon designer in VS2010 for Office 2010 and everything works fine.  Now, I was asked to hide this custom ribbon tab until the right workbook is loaded.  Basically I need to be able to hide or show the ribbon tab depending on the name of the workbook that is activated.  I can't find any way to do this, it is kind of context sensitive tab.  The ribbon load event is fired before a workbook is activated and at the addin startup event I don't know how to access the custom ribbon.  Please point me in the right direction or better to a sample.  Thanks in advance.
Viewing all 5157 articles
Browse latest View live


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