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

Outlook / Word 2016 Insert Html File Grey Pictures.

$
0
0

Hi every body, 

When i'm using InsertFile method to insert an HTML file containing pictures, they are replaced with grey boxes.

It only occurs on Office 2016.

You can find a related topic at Answers Microsoft where the problem is identical.

 

You can use this code to reproduce the bug if you want.

                    string htmlFile = "c:\\MyHtmlFileWithPicutres.html";
                    string docFile = "c:\\myWordDocument.docx";
                    object missing = System.Reflection.Missing.Value;
                    object visible = true;
                    Microsoft.Office.Interop.Word.Application wordApp = new Microsoft.Office.Interop.Word.Application();
                    wordApp.Visible = true;
                    Document doc =
                        wordApp.Documents.Open(docFile, ref missing, ref missing, ref missing, ref missing, ref missing,
                        ref missing, ref missing, ref missing , ref missing, ref missing, ref visible, ref missing, ref missing , ref missing, ref missing);
                    doc.Activate();
                    doc.Range().InsertFile(htmlFile, ref rng, ref confirmConversion, ref link, ref attachment);
                    doc.Close();
                    wordApp.Quit();

Thanks for your replies.


Finding the "ControlId" for various tabs in Outlook

$
0
0

I am using a VSTO project to build an add-in for Outlook and I want to be able to add a "group" to an existing tab. I am using the visual designer to design the ribbon, but in order for my group to show up on an existing tab I need to know the"ControlId", or "OfficeId" (idMso) of the existing tab. I am specifically looking to add a group to an existing tab in the "Contacts" explorer window.



How to get value of the ribbon's ComboBox control?

$
0
0

I would like to apply filtering capabilities in the ComboBox control, where a user types in some text in the ComboBox, and I will filter the list to be populated in the drop-down.

To do this, I need to get the value typed into the ComboBox before populating the drop-down values, how can I get the ComboBox value programatically? I know that if user hits "Enter" after typing some text, it will trigger the OnChange function, but the problem I'm facing is when user types in some text then immediately clicks on the drop-down arrow to show the drop-down list.

When user clicks on the clicks on the drop-down arrow after typing the text, the code goes to getItemCount, getItemLabel, then only onChange, which is too late. I need to get the text input by user during getItemCount itself (or before that), so that I can filter the list to be used in getItemLabel.

Outlook custom calendar - how to set the New Appointment button label?

$
0
0
I created a small test solution to demo an Outlook Add-in 
* Custom calendar
* ReplaceAll Firm Region 
* Customises the Outlook Ribbon.


I then scaled this up for a production version. 

The Outlook Calendar Ribbon New Group the New Appointment button label is "New FScheduler Appointment" 
* The custom Calendar name is  FScheduler
* This did not happen in my demo version - the caption was "New Appointment".
* I have not coded this to happen
* I cannot see any difference between mu demo and production code to cause this

What causes this?



Excel VSTO Addin soft-disabled anf UDFs are shown

$
0
0

I am trying to write some uder defind functions for Excel and am having trouble getting them enabled. I have read most of the posts on this topic and have not been able to overcome this problem. Here is the scenario.

I am running VS2015 and Excel 2013. I do have a VSTO app successfully working that uses a ribbon and a Windows Form. I added another project to this solution for Excel 2013 and 2016 VSTO Add-in, the followed the process of add a Functions class with necessary methods to all register and unregister the function. There are only a couple of trivial functions in the class at this time, just to make sure they should up on the functions list in Excel. I have the project registered from COM interop.

When I start Excel, either using Debug mode from VS or by starting the App, I can see the add-in in several different places. First the Add-Ins table shows MyName.Functions check and listed with the description ProgId: MyName.Functions. Under COMM Add-Ins, there is MyName checked and the location points to the correct dll and the load behavior is 'Load at Startup'.  In Add-Ins options, I see MyName under the Active Application Add-Ins and MyName.Functions under the Inactive Application Add-ins. None of my functions are showing up when I enter a formula in an Excel cell.

I have placed a checkpoint in ThisAddIn_Startup and the method is getting activated. The code in this method reads:

            System.Environment.SetEnvironmentVariable("VSTO_LOGALERTS", "1");
            System.Environment.SetEnvironmentVariable("VSTO_SUPPRESSDISPLAYALERTS", "0");
I have not been successfully in getting any displays or log messages, however.

Where to find Office 2013 PIAs for install

$
0
0

Hello,

Where do we find the Office 2013 Primary Interop Assemblies for distribution?

Also, just to clarify, how backwards compatible are these deploying into prior versions of Office?

Thanks...

Regards,

Michael Powell

Word Paragraph.ID property - what is it for, and is it safe to use it for something else?

$
0
0

During a VSTO Word 2010 add in session, I'd like to "mark" Word paragraphs in some way so that my .NET add in can remember if it has processed a paragraph before (in the same session). I have a simple prototype working fine by setting and getting the Paragraph.ID property with my own ID value.

Can anyone expand on the MSDN documentation? I have no idea what chain of events causes the ID property to be used in "real life". Something to do with saving a web page according to:

http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.paragraph.id.aspx

Unlike the Paragraph.ParaID property, which is reserved for internal use (otherwise I would use it), the ID property seems fair game to be used for what I am using it for. But can someone tell me if it is safe to do so, or if there is a better way to remember Paragraphs you have seen before during a VSTO Word 2010 session?

InstallShield Installation Path

$
0
0

I have created an installation code using the "Deploying an Office Solution by Using Windows Installer"

https://msdn.microsoft.com/en-us/library/cc442767.aspx

My machine is a 64bit running office 64 bit.

I have been told that the code installed in the "32bit" paths on the machine it was installed on.

I created 64bit registry keys.

Where is the "install path" defined (so I can get in the correct folders on the windows 64/office 64 machines)

Thanks

Adam


Adam


Enabling server garbage collection in a VSTO Excel document level add-in

$
0
0

Is it possible to enable the server garbage collection in a VSTO document level add-in for Excel? I'm using VS2010 with a Excel 2010 Workbook project and added an app.config to the project with:

<configuration><runtime><gcServer enabled="true"/></runtime></configuration>

This creates the ExcelWorkbook.dll.config with the setting but checking System.Runtime.GCSettings.IsServerGC at runtime reports false.

When I did the same thing in a console, WPF, or Forms application project, IsServerGC was true and working. Trying the same thing in VS2015 also produced the same results.

Remove focus (Cursor) from Word Addin

$
0
0

Hi,

How can I remove temporarily the cursor blink from the empty document just created?

Thanks 

Custom code for saving InfoPath file locally??

$
0
0

 I would like to give a user the ability to fill a form on SharePoint site and click on save button which would be added directly to the form allowing the user to save file to their local computer version clicking on the built in Submit button in the ribbon that submits the form back to the SharePoint Document library. I wanted to pop up the Save As dialog box and allow them to save the file locally.

On the button's OnClick event there is the following subroutine in Visual Basic present... Could someone assist by providing code to meet the request?

Public Sub CTRL39_5_Clicked(ByVal sender As Object, ByVal e As ClickedEventArgs)
            ' Write your code here.

        End Sub


Select the word i'm typing

$
0
0
i'm new to this.can you tell me how can i catch the word i'm typing in word.

Select recently type word

$
0
0

Hi,

 

i m working on an application which will check the recently typed word and check that word with our database if that word is found it will display the alternative for that word.

 

i m able to solve it if the user typed the word at end of the document and also able to select that word.

 

but the problem comes when the user type in between of the document

eg

 

this is first paragraph

this is second paragraph

 

user will type here ashish now

 

this is fourth paragrahp

 

i should able to select the word "here" and should get the word position as 3 paragraph and 4th word

 

Thanks n Regard

Ashish Sharma

VS2013\15 Coded UI is not identifying ASP.Net application while VS 2012 Coded UI is identifying and has no problem

$
0
0

I am using VS2012 Coded UI to automate ASP.net application (browser hosted in windows) i.e. launching application through launcher. I want to migrate to VS2013/VS2015 Coded UI; I observed VS2013/VS2015 Coded UI is not identifying the same application control which is identified by VS2012 Coded UI test. Since the application is same, it is not clear why VS2012 Coded UI is identifying but VS2013/15 is not identifying.

Coded UI test builder spy hangs when we put cross hairs on the control. Same thing happens when we try to do recording but everything works fine with VS2012 Coded UI.

Currently we are blocked because of this issue. Please help on this

Also, can you please let me know how to raise ticket with Microsoft related to VS Coded UI issue

Send info on a row to new row after finding the next empty cell of a row.

$
0
0

Hi,

I have a sheet that has info in columns B, C, D, E, F and buttons in each row of column A. There is always info in column "B" but not always in the other columns of that row. I want to click a button to send the info in the row the button is associated with to the next row with an empty cell in column "J" so that if row 7 of column "J" is the next empty cell of that column then the info from B, C, D, E, F of the row associated with the button will be put into cells J7, K7, L7, M7, N7 even if some of the cells in the other columns are empty.

I have tried using this code but it puts the info in the next empty cell of Each column and the info gets separated:

Sub a11AddToNextCell()
x = Cells(Rows.Count, "J").End(xlUp).Row
nar = Range("J1:J260" & x).Find("").Row
Cells(nar, "J").Value = Range("B11").Value
x = Cells(Rows.Count, "K").End(xlUp).Row
nar = Range("K1:K260" & x).Find("").Row
Cells(nar, "K").Value = Range("C11").Value
x = Cells(Rows.Count, "L").End(xlUp).Row
nar = Range("L1:L260" & x).Find("").Row
Cells(nar, "L").Value = Range("D11").Value
x = Cells(Rows.Count, "M").End(xlUp).Row
nar = Range("M1:M260" & x).Find("").Row
Cells(nar, "M").Value = Range("E11").Value
x = Cells(Rows.Count, "N").End(xlUp).Row
nar = Range("N1:N260" & x).Find("").Row
Cells(nar, "N").Value = Range("F11").Value
End Sub

That works fine for individual cells but I need the Row of info to be posted to the same row so that the info on that row is not separated. 

Please help a novice,

Thanks

FoosMaster


Runtime prq for x64 with Office 64

$
0
0

I need to update my prq with the correct settings for Windows x64 with Office 64, but can't find an example.

***********************************************

current prq

***********************************************

<?xml version="1.0" encoding="UTF-8"?>
<SetupPrereq>
<conditions>
    <condition Type="32" Comparison="2" Path="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VSTO Runtime Setup\v4R" FileName="Version" ReturnValue="10.0.50903" Bits="2"></condition>
<condition Type="32" Comparison="2" Path="HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VSTO Runtime Setup\v4R" FileName="Version" ReturnValue="10.0.50903" Bits="2"></condition>
</conditions>
<files>
    <file LocalFile="&lt;ISProductFolder&gt;\SetupPrerequisites\VSTOR\vstor_redist.exe" URL="http://download.microsoft.com/download/C/0/0/C001737F-822B-48C2-8F6A-CDE13B4B9E9C/vstor_redist.exe" CheckSum="88b8aa9e8c90818f98c80ac4dd998b88" FileSize=" 0,40117912"></file>
</files>
<execute file="vstor_redist.exe" returncodetoreboot="1641,3010" requiresmsiengine="1">
</execute>
<properties Id="{FD82F4D6-2DB1-4000-AB20-1BBF266B52FF}" Description="This prerequisite installs the most recent version of the Microsoft Visual Studio 2010 Tools for Office Runtime." >
</properties>

</SetupPrereq>

***********************************************

only one I could find

***********************************************

<?xml version="1.0" encoding="UTF-8"?>
<SetupPrereq>
    <conditions>
        <condition Type="32" Comparison="2" Path="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VSTO Runtime Setup\v4R" FileName="Version" ReturnValue="10.0.30319"></condition>
    </conditions>
    <operatingsystemconditions>
        <operatingsystemcondition MajorVersion="6" MinorVersion="0" PlatformId="2" CSDVersion="" Bits="4" ServicePackMajorMin="2"></operatingsystemcondition>
        <operatingsystemcondition MajorVersion="5" MinorVersion="2" PlatformId="2" CSDVersion="" Bits="4" ProductType="2|3" ServicePackMajorMin="2"></operatingsystemcondition>
        <operatingsystemcondition MajorVersion="6" MinorVersion="0" PlatformId="2" CSDVersion="" Bits="4" ProductType="2|3" ServicePackMajorMin="2"></operatingsystemcondition>
        <operatingsystemcondition MajorVersion="6" MinorVersion="1" PlatformId="2" CSDVersion="" Bits="4"></operatingsystemcondition>
    </operatingsystemconditions>
    <files>
        <file LocalFile="&lt;ISProductFolder&gt;\SetupPrerequisites\VSTO 2010 Runtime\x64\vstor40_x64.exe" URL="http://go.microsoft.com/fwlink/?LinkId=158919" CheckSum="6A8453A6C07A07B72F8DAF4361A5EABF" FileSize="0,111363"></file>
    </files>
    <execute file="vstor40_x64.exe" cmdline="/q:a /c:&quot;install /q /l&quot;" cmdlinesilent="/q:a /c:&quot;install /q /l&quot;" returncodetoreboot="1641,3010" requiresmsiengine="1"></execute>
    <properties Id="{B6F010E8-4696-4879-A9F3-682F3E3C04F4}" Description="This prerequisite installs the Microsoft Visual Studio 2010 Tools for Office Runtime (64bit)."></properties>
    <behavior Reboot="2"></behavior>
</SetupPrereq>


Adam

How to Activate build-in Tab when select a chart

$
0
0

I dev a excel addin.

When use excel, user active some other tab and then select a picture in sheet, excel will not auto active format tab

How to Activate build-in Tab idMso="TabPictureToolsFormat" by use my code?


Getting data of list object filters for date column

$
0
0

In my project, we need to get some data from our list object filters. We get them by accessing listObject.AutoFilter.Filters.

I noticed that I'm not able to get the data for date columns. Let's say I have a date column where I filter to show only rows with the year 2016. When trying to get the data from the filter, my Criteria1 and Criteria2 throws this exception:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x800A03EC

For other types on column (like text column), I'm able to get the data just fine.

Please advise.

Outlook - Prevent a user from removing an Appointment attachment

$
0
0

A VSTO Outlook Add-In using an Adjoining Form Region

I need to prevent a user from Removing Attachments

* There is no "BeforeAttachmentRemoved" event 

In Outlook a user removes an attachment by selecting an Attachment and :

  1. Right-clicking on an Attachment and selecting "Cut" from the Context Menu. How to hide the "Cut" button"?
  2. Pressing the  'Delete" key. How to intercept and cancel this ?

NOTE in the Context Menu  I would ideally want to hide the Cut/Copy/Paste buttons 


Outlook - Prevent a user from editing an Appointment "Subject"

$
0
0

A VSTO Outlook Add-In with an Adjoining Form Region

How to prevent a user from editing the Outlook Appointment Subject? 

Viewing all 5157 articles
Browse latest View live


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