473,625 Members | 3,064 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VS 2005 Tools for Office - Action pane list box problem

Hello,
The actions pane locks up after selecting a listbox.

I have tried all kinds of things and have narrowed it down to this. If
I click in the listbox the action pane locks up. Neither a combo box
nor a button will work after clicking in the list box. There are no
events associated with the list box. This is a mystery to me.

What could be causing this behavior? What could be the remedy?

Here is the Action Pane code
\\\
Public Class ActionsControl
Private Sub ActionsControl_ Load(ByVal sender As Object, ByVal e As
System.EventArg s) _
Handles Me.Load
Me.SuppliersTab leAdapter.Fill( Me.NorthwindDat aSet.Suppliers)
Me.ProductsTabl eAdapter.Fill(M e.NorthwindData Set.Products)
End Sub
Shared Sub SetHeadings(ByV al tblCell As Word.Cell, ByVal text As
String)
'The first time the table is made
With tblCell.Range
.Text = text
.Font.Bold = True
.ParagraphForma t.Alignment =
Word.WdParagrap hAlignment.wdAl ignParagraphCen ter
End With
End Sub
Private Sub AddData(ByVal row As DataRow, ByVal companyName As
String)
' Create a table if it doesn't already exist.
If Globals.ThisDoc ument.Tables.Co unt = 0 Then
Try
' Create a table.
Dim tbl As Word.Table =
Globals.ThisDoc ument.Tables.Ad d( _
Globals.ThisDoc ument.Applicati on.Selection.Ra nge,
1, 4)
' Insert headings.
SetHeadings(tbl .Cell(1, 1), "Company Name")
SetHeadings(tbl .Cell(1, 2), "Product Name")
SetHeadings(tbl .Cell(1, 3), "Quantity")
SetHeadings(tbl .Cell(1, 4), "Unit Price")
Catch ex As Exception
MessageBox.Show ("Problem creating Products table: " &
ex.Message, _
"Actions Pane", MessageBoxButto ns.OK,
MessageBoxIcon. Error)
End Try
End If
' Add data from data row to the table.
Dim selection As Word.Selection =
Globals.ThisDoc ument.Applicati on.Selection
If selection.Table s.Count > 0 Then
Dim newRow As Word.Row =
Globals.ThisDoc ument.Tables(1) .Rows.Add()
With newRow
.Range.Font.Bol d = False
.Range.Paragrap hFormat.Alignme nt =
Word.WdParagrap hAlignment.wdAl ignParagraphLef t
.Cells(4).Range .ParagraphForma t.Alignment =
Word.WdParagrap hAlignment.wdAl ignParagraphRig ht
.Cells(1).Range .Text = companyName
.Cells(2).Range .Text = row.Item("Produ ctName").ToStri ng

.Cells(3).Range .Text =
row.Item("Quant ityPerUnit").To String
.Cells(4).Range .Text =
Math.Round(row. Item("UnitPrice "), 2)
End With
Else
MessageBox.Show ("Cursor must be within a table.", _
"Actions Pane", MessageBoxButto ns.OK,
MessageBoxIcon. Error)
End If
End Sub
Private Sub Insert_Click(By Val sender As System.Object, ByVal e As
System.EventArg s) Handles Insert.Click
Dim tbl As DataTable = NorthwindDataSe t.Products
Dim rows() As DataRow
' Check if a product is selected.
If Not Me.ProductNameL istBox.Selected Index < 0 Then
Dim product As String =
Me.ProductNameL istBox.Selected Item.Row.Item(" ProductName")
Dim company As String = Me.CompanyNameC omboBox.Text
' Return the data row from the selected Product in the list
box.
rows = tbl.Select("Pro ductName = '" & product.Replace ("'",
"''") & "'")
AddData(rows(0) , company)
Else
MessageBox.Show ("Please select a product.", "Actions Pane",
MessageBoxButto ns.OK)
End If
'LoadTables()
End Sub
End Class
///

By the way, this comes from an an tutorial exercise in MSDN2 at this
address;
http://msdn2.microsoft.com/library/m...US,VS.80).aspx

I would expect it to work. All code is copied from the exercise?

Jan 30 '06 #1
0 1226

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2116
by: Unigroup of New York | last post by:
Content-Type: multipart/mixed; boundary="------------C465DF38DCB38DD2AF7117E0" Lines: 327 Date: Tue, 15 Feb 2005 23:36:38 -0500 NNTP-Posting-Host: 24.46.113.251 X-Complaints-To: abuse@cv.net X-Trace: fe12.lga 1108528794 24.46.113.251 (Tue, 15 Feb 2005 21:39:54 MST) NNTP-Posting-Date: Tue, 15 Feb 2005 21:39:54 MST Xref: number1.nntp.dca.giganews.com comp.lang.python:398656
13
1938
by: Howard Kaikow | last post by:
I just visited the MSFT web site and saw the comparison/pricing of the different VS 2005 versions. I was looking for a statement of the system requirements for VS Pro and VSTO, could not find. Also, more details on the differences between VS Pro and VSTO. For example, can VSTO be used to create a DLL, in particular, a DLL that can be used as an ActiveX DLL with Office? In VSTO, other than the addition of the support for Office 2003...
0
930
by: dbuchanan | last post by:
Hello, The actions pane locks up after selecting a listbox. I have tried all kinds of things and have narrowed it down to this. If I click in the listbox the action pane locks up. Neither a combo box nor a button will work after clicking in the list box. There are no events associated with the list box. This is a mystery to me. What could be causing this behavior? What could be the remedy?
2
2793
by: Le | last post by:
Folks, I'm trying to do some office automation using VSTO 2005. I've verified that ..Net Programmability Support is installed for every MS Office application and Microsoft Forms 2.0 .Net Programmability Support is also installed under Office Tools through Office Setup. I've then installed VSTO 2005 (vstor.exe, http://www.microsoft.com/downloads/details.aspx?familyid=f5539a90-dc41-4792-8ef8-f4de62ff1e81&displaylang=en). After installing...
0
1734
by: Kevin G. Anderson | last post by:
What: CAUG Meeting - Visual Studio 2005 Tools for Office When: Thursday, April 27, 2006, 6PM Who: Jacob Cynamon, Microsoft Where: The Information Management Group 200 W. Monroe St. Suite 900 Chicago, IL 60606 (312) 222-9400 Location: www.imginc.com/IMG/About+IMG/chicago.htm info@caug.com and add "ATTENDING" to the subject
3
3157
by: Arpan | last post by:
I recently installed SQL Server 2005 (Management Studio Express) along with SQL Server 2005 Express (Configuration Manager) in my Win2K Pro m/c & use IIS 5.0 to run ASPX projects. I could add my database, named "MyDB", successfully. I am using the Windows Authentication mode to login to SQL Server. My server name is "AD\SQLEXPRESS" where "AD" is the name of my m/c. I could even establish a connection to the server & the database from...
3
1741
oll3i
by: oll3i | last post by:
package zad41; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.*; import java.net.*; import javax.swing.BorderFactory;
3
3254
by: Lee T. Hawkins | last post by:
I am having a number of problems over the last two full days trying to get an ASP.NET 2.0 application to connect to a SQL Server 2005 database... First off, I built this application w/ Visual Studio 2005 SP1 and had it working perfectly on my Windows XP machine on SQL Server 2005 Express. I decided to publish this application to a test development server (with both the SQL and IIS servers on the same box) running on: Windows Server...
0
8259
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8192
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8696
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8637
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8502
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5571
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4195
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2621
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1805
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.