Ahmed Salaheldin's Q&A profile
Visual Studio Tools for Office Guidance on passing data to VSTO docs / spreadsheets
I have two vsto apps. One in Outlook, one in Word. I would like to pass some data about the current item selected in Outlook to the word document. If this were two standard .NET apps, I could use args to pass the data, .NET remoting, etc. When faced with VSTO, the standard command line is that of Word, not a .NET assembly. In it's simplest form, I would like to do: Get selected item in Outlook and put in variable foo Do a 'Process.start' on word and pass variable foo In the VSTO startup of the doc, parse variable foo Is this possible or is there some recommended alternative for doing this standard pattern Hello Bart Elia, i have done some similar but not with VSTO, but should work s ...Show All
Windows Forms Prevent Access to Alt-Tab Menu
Does anyone know how I can prevent access to the Alt-Tab menu when a specific form is in focus The application is designed to have a mode where it can be left unattended and people (ie: not the owner of the computer, people who should not be allowed to access anything on the computer) can use the interface to perform certain tasks. While performing these tasks, the user should not be able to access anything else on the computer without entering a password (not the system password, a password set by the main user when entering this application mode). My question to you (if you have an answer) is how can I block access to the Alt-Tab menu while in this particular Form ...Show All
.NET Development convert datareader into a datarow
For every record in a datareader I'm trying to read that into a datarow and store it in a memory resident datatable. After creating the datareader, I declare a table in memory like this: DataTable table = reader.GetSchemeTable(); Then DataRow row = table.NewRow(); for(int i = 0; i < reader.FieldCount; i++) { row[ i ] = reader[ i ]; } table.Rows.Add(row); But it keeps throwing an exception saying "Value was either too large or too small for an Int16". The datatypes in the table the reader is reading from are: bigint bigint bigint int varchar And it crashes as soon as the field index reaches the varchar field. That's when it throws the above exception. How do I get around this Well, it looks like you're ...Show All
SQL Server "Synchronize Connection Strings" Dialog box with XML Config file
Hello, This has been happening to me since I started using Configuration files. I use one XML config file that stores Machine Specific settings and one connection string to my Metadata database. The problem is the database connection. When I set the conection in the Configuation file, save, close and reopen the package, a dialog box opens with the title "Synchronize Connection Strings". To reproduce the problem: 1. Ceate New SSIS Project 2. New Data Source Localhost.Adventureworks 3. In Package.dtsx create an New Connection from Data Source... 4. Choose AdventureWorks 5. Save Package 6. Close Package 7. Open Package There is no problem at this point. 8. Enable Package Configurations 9. Create a new XML C ...Show All
Visual Studio Express Editions Create error log text file
How do you go about creating an error log from a text file, then once the file is made, write back to that file if another error is caught I can take care of the Try,Catch statements, but I need a little help creating the file in a desirable location, then if it exists when another error is generated, find the file and add to it. The location would be a shared file, do you think there would be any share violations from a file that was created remotely I thought of using a db file but, if there are network issues, that wouldnt be good since this app will be shared across a network. Davids Learning It looks like the My.Application.Log is a wrapper for the Trace listeners which would be anot ...Show All
.NET Development Locale of ThreadPool's Thread
Is there any way to modify CurrentCulture/CurrentUICulture of ThreadPool's threads OR to set the default values of these properties for every thread created within a process If you are going to use the TP and you want to ensure that it uses a specific culture then you must set the culture explicitly when you start the TP method. The TP is shared by both your code and the framework. There are no guarantees that the framework won't change the culture for whatever reason. Therefore you'll need to set it each time you invoke the TP. For your own thread the default culture is determined by Windows itself so you'll have to set it explicitly when the thread is started. Michael Taylor - 12/21/06 ...Show All
Visual FoxPro Once again all hell breaks loose...
Once again I have made the fatal mistake of god forbid changing the record source of a grid in the design stage. I can't understand this issue: Now the formatting of the grid at run time is different (and can not be controlled at design time). Also, the grid columns get populated in the order of the new view I am using REGARDLESS of the fact that I am specifically setting the controll source per column to the proper field. Previously Cetin has sugested that during my select stage I would select only the fields used in the grid and in the order used in the grid but this will cause problems. Is there a solution to this bug (or is it a feature) in VFP This is driving me nuts.. Thank you all.. ...Show All
Smart Device Development NodeFont property in TreeView
I am using Visual Studio 2005 and .Net CF 2.0. There is no nodedfont property in .net CF. What I want to do is set bold on the parents, and normal for childs. What is the workaround The NodeFont property is not supported on .NETCF. You may be able to use TreeNode's Handle property and PInvoke to native code to set the Font property. See http://msdn.microsoft.com/library/en-us/wceui40/html/cerefTVM_SETITEM.asp ...Show All
Visual Studio Tools for Office Assembly location during debug differs from output folder
Hello, I'm migrating a Word 2003 shared addin to a VSTO 2005 SE Word 2007 Addin. This addin uses some xml files which should be located in the same folder as the Addin is. In the previous version I looked these files up by using the System.Reflection.Assembly.GetExecutingAssembly.Location This worked perfect, but now If I debug the project all the required files are copied to the bin\Debug folder but the System.Reflection.Assembly.GetExecutingAssembly.Location give me a location that is comparable to C:\Users\ username \AppData\Local\assembly\dl3\RT5TDQVD.CGJ\T81B2ATH.YXM\65ce212f\0dea5369_3e50c701 This folder is created on every debug and it does not contain my xml files. Who knows a solution for this problem ...Show All
Gadgets How do I do this: ?
There are several things I want to do. First off what I am doing is reworking a gadget that was made to play mp3s from WMP, this gadget also displays the song track, artist & album. The problem I have is that I don't find it flexible enough and it's just ugly looking to boot, I have so far reworked the interface so that it is much nicer looking visually tho still needs some work, got rid of the album art in the interface BUT I still want to be able to display the art but in a flyout which while I can get the flyout itself to work it does not display the album art and would like to know how to reference the working javascript that was in the parent window/gadget to display the image in the flyout. I am also trying to add functi ...Show All
Windows Forms Searching for specific text data in the datagridview control
I have been tearing my hair out looking for a way to search all the rows in a selected column of a databound datagridview control for specific text (like a combo box lookup) without success. I am beginning to think that it is not supported and I will have to buy something like vsflexgrid.net. Is there a way to do this without buying a third party control the link http://msdn2.microsoft.com/en-us/library/ms993124.aspx demonstrates the use of a control known as FindStrip Control. This might be useful. ...Show All
Visual Basic How to process Large Binary Files
I'm trying to read Test.bin but I keep getting out-of-memory error The file size is >300MB. I can read smaller files well - but large files are a problem. Anyone has a good snippet fileContents = My .Computer.FileSystem.ReadAllBytes( "C:\Test.bin" ) Thanks. When I ran the program (in IDE - VS2005) the debugger pointed out the fact that there was an error (can't remember which - since I've long abandoned the program). In the CMD window, it stated that file not found - I assume it meant Copy.exe. Even a simple Shell-copy command from VB2005 std failed. ...Show All
SQL Server SQLCMD - CANT PASTE PUBS SCRIPT IN SQLCMD
I have VSWEBDEVELOPER INSTALLED. TO EXECUTE AND CREATE PUBS DATABASE, I AM TRYING TO COPY PUBS INSTALLATIOIN SCRIPT AND PASTE IN SQLCMD BUT ITS NOT HAPPENNING. SQLCMD STAYS FOR FEW SECONDS AND QUITS AUTOMATICALLY. IS THERE ANY OTHER WAY TO DO THIS. I HAVE BEEN CONNECTED TO THE DATABASE AND WANT TO CHECK DATABASE FEATURES. ...Show All
Windows Forms Simple yet annoying question about DataGridViewTextBoxColumn
One of the columns I read from database is a boolean . Basicly its being False means Gender is "Male" , True means "Female". In DataGridView i want that column to say their gender but i cant make it work if i try to set that column's value to "Female" by dgvList(e.RowIndex).Cells("Gender").Value = "Female" on CellFormatting event, it tells me "Female" isnt a Boolean. Telling me i can only set "True" or "False" in that column. Help The Events i tried i think it might help you get the idea of what im trying to do: Private Sub dgvListe_CellPainting( ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellPaintingEventArgs) Handles dgvListe.CellPainting 'If dgvListe.Columns(e.Colu ...Show All
Visual C++ another date related problem
I wrote a program that asks for a year and a day number between 1 and 366. It returns the date for that year and day number in the format: "Weekday, nnth Month year" where Weekday is the name of the weekday nnth is the day of the date (with the appropriate suffix: st, nd, rd, or th) Month is the name of the month and year is the year. I wrote this program incorporating the System namespace and using the Console functions. I used the DateTime object to get the current date and set variables for the current year, current dayOfYear and current dayOfWeek. The program is working correctly. I also wrote code using the std namespace. To get the date I used ctime. The following is the code I used: time_t mytime; s ...Show All
