|
Hi
I have created an Shared Add In application for MS Office. In that
I am trying to remove an Button, which is added to standard tool bar in MS word.
I am using following code to add an button in MS Word. Which written on OnStartUpComplete event.
Dim WithEvents MyButton As CommandBarButton
Dim oCommandBars As CommandBars
Dim oStandardBar As CommandBar
On Error Resume Next
oCommandBars = applicationObject.CommandBars
If oCommandBars Is Nothing Then
oCommandBars = applicationObject.ActiveExplorer.CommandBars
End If
oStandardBar = oCommandBars.Item("Standard")
If oStandardBar Is Nothing Then
oStandardBar = oCommandBars.Item("Database")
End If
If MyButton Is Nothing Then
MyButton= oStandardBar.Controls.Add(1)
With MyButton
.Caption = "My Button"
.Style = MsoButtonStyle.msoButtonCaption
.OnAction = "!<mycomaddin.connect>"
.Visible = True
End With
End If
I have written following code to remove button
On OnBeginShutDown event
On Error Resume Next
MyButton.Delete()
MyButton= Nothing
but its not working
Anyone can help me please.
Thanks & Regards
AMOL
|
|
|
|
|
I made a VB.NET Control used in VB6 Application... I checked the Register Object fo Com Interop in the project properties. after compiling placed it in a testing machine tried registering it and gives an error "The DLLRegisterServer entry point was not found. File Cannot be registered." so i placed this code inside the control guessing this would somehow solve the problem...
-------------------------------------------------------------------------------------
Public Class ComRegistration
#Region "COM Registration "
' This function is called when registered
<comregisterfunction()> _
Private Shared Sub ComRegister(ByVal t As Type)
Dim keyName As String = "CLSID\" & t.GUID.ToString("B")
Dim key As RegistryKey = Registry.ClassesRoot.OpenSubKey(keyName, True)
key.CreateSubKey("Control").Close()
Dim subkey As RegistryKey = key.CreateSubKey("MiscStatus")
subkey.SetValue("", "131457")
subkey = key.CreateSubKey("TypeLib")
Dim libid As Guid = Marshal.GetTypeLibGuidForAssembly(t.Assembly)
subkey.SetValue("", libid.ToString("B"))
subkey = key.CreateSubKey("Version")
Dim ver As Version = t.Assembly.GetName().Version
Dim version As String = String.Format("{0}.{1}", ver.Major, ver.Minor)
If version = "0.0" Then version = "1.0"
subkey.SetValue("", version)
End Sub
' This is called when unregistering
<comunregisterfunction()> _
Private Shared Sub ComUnregister(ByVal t As Type)
' Delete entire CLSID\{clsid} subtree
Dim keyName As String = "CLSID\" + t.GUID.ToString("B")
Registry.ClassesRoot.DeleteSubKeyTree(keyName)
End Sub
#End Region
------------------------------------------------------------------------------------
after compiling the project and registering it in a testing machine still doesnt work...
Can anyone help me? I might have missed something...
|
|
|
|
|
You don't need that code in your component. You can't use REGSVR32 to register a COM exposed .NET component. You have to use REGASM[^] for that.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Ok now thats a big help... thanks...
|
|
|
|
|
Hi all,
I am developing a shopping cart with VS.net 2005, but have some problems about cookies.
my project workflow is, once i click an "Add to cart" button, the images of selected product are put into the shopping cart page, and then when i click "Buy Now" button, if the user has already loggin, all images' urls are saved into the SQL database, otherwise, the user will be reminded to login.
I am trying to save all images' urls into cookies and put into a dataset first, because i need to show them in the shopping cart page without putting urls into database, but i am not sure whether i can save several image urls from different panels at one time, and also is the cookies solution the best one, so can anyone give me help??
Thanks a lot!
cheers
Jackie Ding
Jackie Ding
|
|
|
|
|
You can store any text you like in cookies. You should be aware of two things when you are using cookies in this way, though:
:: There is a size limit for all the cookies from your site. The limit varies somewhat depending on the browser, but a typical value is 4 kb. If you try to store more than this, the browser just stops accepting more cookies.
:: All the cookies that you set will be sent in every request to the server. This increases the traffic to the server and the response time for every page.
I would suggest that you store the information in a separate table in the database until the user gets to the checkout counter.
---
b { font-weight: normal; }
|
|
|
|
|
Hi Guffa,
Thank you for your reply...It's really helpful!!
but if i store information in a separate table, shall i build relationship between it and other tables, like user table? or just keep it seperate all the time, and once the user logs in, the information from the seperate table will be put into the "orders" table, which is related to the "user" table???
i am looking forward your reply, thanks again!!!!
cheers
Jackie Ding
|
|
|
|
|
What you store in the table is up to you. If you want to tie it to the user table, you need to know who the user is, i.e. the user has to be logged in.
---
b { font-weight: normal; }
|
|
|
|
|
ok....
i think i'd better keep it seperate!!;P
thanks a lot
cheers
Jackie Ding
|
|
|
|
|
Hi,
i want to merge 2 cells in excel when i am Exporting data from datagrid to cells. how can i do that .please send me a reply.
i am using code like this to export data
Dim XlApp As Excel.Application
Dim XlBk As Excel.Workbook
Dim XlSht As Excel.Worksheet
Dim r As Excel.Range
XlApp = CreateObject("Excel.Application")
XlBk = XlApp.Workbooks.Add
XlSht = XlBk.Worksheets(1)
XlApp.Visible = True
XlApp.Cells(1, 2).Font.Name = "Arial"
XlApp.Cells(1,2).Font.Bold = True
XlApp.Cells(1, 2).Font.Size = 9
XlApp.Cells(1, 2).value = "Mode Of Shipment"
r = XlApp.Cells(1, 2)
r.ColumnWidth = "Mode Of Shipment".ToString.Length * 1.5
XlApp.Cells(2, 2).Font.Name = "Arial"
XlApp.Cells(2, 2).Font.Bold = False
XlApp.Cells(2, 2).Font.Size = 9
XlApp.Cells(2, 2).value = DtGenReport.Rows(0)("Item").
if the heading is large i want to merge 2 cells.
Thanks and Rgards
Anu
|
|
|
|
|
hi,
try using this statement
objExcel.Range(a1,b1).Merge
hope this works.
Nitin...
|
|
|
|
|
Why won't this code clear all of the data from the ORDERS table?
I must be missing something obvious!
thank you!
Me.DataSet1.ORDERS.Clear()
Me.DataSet1.ORDERS.AcceptChanges()
|
|
|
|
|
I have use RichTextBox in my application, i want to use many color and fonts and i want to remember.
Thanks
................
|
|
|
|
|
the vb code is :
Private Sub Command1_Click()
RichTextBox1.SelStart = 0
RichTextBox1.SelLength = 4
RichTextBox1.SelColor = vbRed
RichTextBox1.SelFontSize = 14
RichTextBox1.SelStart = 6
RichTextBox1.SelLength = 3
RichTextBox1.SelColor = vbBlue
RichTextBox1.SelFontSize = 16
End Sub
Private Sub Form_Load()
RichTextBox1.Text = "I'm From China,Welcome to My Blog,http://myfend.bokee.com"
End Sub
|
|
|
|
|
How to resize an image in VB6 ?
Luay Al-wesi
|
|
|
|
|
Hello,
I'm developing with VB.net 2. I designed a class library which contains a formular and a console application as a starter for the library. If I start the project the library shows the formular and that hangs. Did anyone know a solution for me?
vocaris
|
|
|
|
|
There's only about 10,000 reasons your app can hang. Start you app in debug mode and step through the code to try and see where it's hanging. Once it's narrowed down to that, you can ask a more specific question. Be sure to post some code where the app is hanging too.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi,
Please help in coding my combo box.
I wanted the code below to bind to my database.
but it only got bound to the first record only.
Try
myadapter.Fill(myset, "doc_reg")
Dim mytable As New DataTable()
mytable = myset.Tables("doc_reg")
myview = mytable.DefaultView
cbodoctor.DataBindings.Add("text",myview, "lname&fname&" / "& dcode")
Catch myerror As Exception
MsgBox(myerror.Message)
End Try
Else
MsgBox("Open Conection Please")
End If
Want to concatenate three columns and bind it to a combobox. All the data in the column.
thanks.
Fikunmi Feyijin
Hicad Systems
Nigeria
|
|
|
|
|
A much easier approach to that is concatinate the three columns as a Single column in the QUERY. Fetch and bind that column.
Mubashir
Every job is a self portrait of the person who did it.
|
|
|
|
|
Dim mytable As New DataTable()
mytable = myset.Tables("doc_reg")
cbodoctor.DataSource = mytable
cbodoctor.DisplayMember = "ColumnName"
cbodoctor.ValueMember = "ColumnName"
|
|
|
|
|
My ASP.Net 2.0 web application launches a VB.Net 2005 Smart Client. How to I debug 'into' the smart client when they are separate VS 2005 Solutions ? I tried adding a 'reference' to the sc .exe but this did not seem to work.
Does anyone know how to make this work or where I can find a solution?
Many Thanks!
|
|
|
|
|
You can either setup remote debugging or if you're testing on the same machine, you can setup two Visual Studio sessions. One for your ASP.NET code and the other will have to Debug/Attach to the process launch by your browser session. It can only do that AFTER the process is launched however.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I need to determine if a number is in integer. It needs to be a whole integer and cannot be alphanumeric, or decimal. I tried isnumeric, but isnumeric still returns decimals, I need a function that will exclude decimals.
Posted by The ANZAC
|
|
|
|
|
Why not just force it to an Integer?
Dim x As Integer = CInt(myNumber)
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
i can't force it because i need to divide one number by another and check if it's a whole number, forcing it would defeat the purpose of determining if it's integer or decimal.
Posted by The ANZAC
|
|
|
|