|
i think, i tried this one already, and it didn't work. but maybe something went wrong. i will try again. thanks for your answer.
|
|
|
|
|
Hi, I've been trying to add abutton to the outlook commandbar and have a problem with the following code
Dim commandBar As Office.CommandBar
Dim firstButton As Office.CommandBarButton
Dim secondButton As Office.CommandBarButton
Private Sub AddToolbar()
Try
commandBar = Globals.ThisAddIn.commandBar
Catch ex As ArgumentException
End Try
If commandBar Is Nothing Then
* commandBar = Globals.ThisAddIn.commandBar.Controls.Add_(Office.MsoControlType.msoControlButton, 1)
End If
It generates an error on the line with a * saying "Object reference not set to an instance of an object." Any ideas why?
|
|
|
|
|
Makes sense to me take a second look at what your doing:
1.) commandBar = Globals.ThisAddIn.commandBar
2.) If commandBar Is Nothing Then
* commandBar = Globals.ThisAddIn.commandBar.Controls.Add_(Office.MsoControlType.msoControlButton, 1)
End If
but remember commandBar was assigned as Globals.ThisAddIn.commandBar so if commandBar is nothing, the you cant say:
= Globals.ThisAddIn.commandBar.Controls.Add_(Office.MsoControlType.msoControlButton, 1)
because Globals.ThisAddIn.commandBar is nothing
Pablo
Sometimes I think there's no reason to get out of bed . . . then I feel wet, and I realize there is.
|
|
|
|
|
Thank you, been looking at others code and they all seem to do that, fixed it now
Thanks again
|
|
|
|
|
Any time
Pablo
Sometimes I think there's no reason to get out of bed . . . then I feel wet, and I realize there is.
|
|
|
|
|
Is it possible to use assembly language mixed with VB.Net?
Pablo
Sometimes I think there's no reason to get out of bed . . . then I feel wet, and I realize there is.
|
|
|
|
|
No, it's not. There is no facility in VB.NET or in the .NET BCL to embed processor-specific native code into the compiled IL or your application.
VB.NET, C#, or any other Managed Code does not compile to native assembly language, but instead, compiles to MSIL (Microsoft Intermediate Language). IL is a processor-independant language that is only understandable by the .NET CLR. That code is compiled to the processor-specific native code at runtime when the CLR needs it to execute.
You can, however, use Visual C++ to create library modules that contain native assembly and are callable by your VB.NET code. There is a price to be paid though. Jumping from the managed code execution environment of the .NET CLR to the unmanaged environment and passing method parameters and return values back and forth is a moderately expensive process. So, the gains you get in the assembly module might be lost to marshalling many calls back and forth to unmanaged code.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Now you've gone and made me sad
jk thanks for the info, very helpfull
Pablo
Sometimes I think there's no reason to get out of bed . . . then I feel wet, and I realize there is.
|
|
|
|
|
Hi every one,
I created an Office Com Addin project in visual studio 2005 (File>new project>other project types >Shared Add-in),the OS is winXp and I have Office 2003 .
I would like to debug my project and I put break point in Connect.vb over "OnConnection Sub" ,but when I run my project,word is opened but I can not trace my project ,running is not return back to my project ,I mean break point is not work correctly and I think there is not any link between my Addin project and word ,I don't know what is the reason of this problem.
I would appreciated for any help .
yours sincerely,
Orchid.
|
|
|
|
|
I don't do Office Interop or extensions, but it would seem that you have to attach the VS debugger to Word before you try to lanuch your Add-In.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Does anyone know how to adjust the speaker balance while playing a sound?
-- modified at 23:27 Saturday 16th December, 2006
P.S. Not using DirectX...preferably using Windows API.
Pablo
Sometimes I think there's no reason to get out of bed . . . then I feel wet, and I realize there is.
|
|
|
|
|
Are you embedding Windows Media Player in your program to play sound?
|
|
|
|
|
At the moment im using
Private Declare Auto Function mciSendString Lib "winmm.dll" (ByVal cmd As String, ByVal ret As StringBuilder, ByVal retLen As Integer, ByVal hwnd As IntPtr) As Integer
that way I have the option of using a player...or just a sound
Pablo
Sometimes I think there's no reason to get out of bed . . . then I feel wet, and I realize there is.
|
|
|
|
|
There has to be an API for doing this in windows...sndvol32 does it in XP...Maybe I should look for the command line arguments for it, but then it would make the app XP dependant....hmm what to do what to do
Pablo
Sometimes I think there's no reason to get out of bed . . . then I feel wet, and I realize there is.
|
|
|
|
|
All,
I've created a timer program that when it ends, displays a password form (no border) via showdialog that is maximized when displayed. The form contains one group box that holds my text box to enter the psw in and an enter button to confirm.
My problem is that I won't know what resolution a person screen may be set to and when the form loads on their PC, I want the group box to be centered in the middle of the form to ensure it will always be visible.
I know it sounds simple (probably is), but I can't seem to get the group box to center when I try different resolutions. My fear is that if I don't get it to center, it may very well show too far off to one side on someones computer and they will not be able to do anything but shutdown. Plus centered looks must more professional as well.
All help is greatly appreciated!
Thanks, everyone.
- Harold
|
|
|
|
|
Private Sub Form1_ResizeBegin(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize<br />
Dim x As Integer = CInt((Me.Size.Width / 2) - (Me.GroupBox1.Width / 2))<br />
Dim y As Integer = CInt((Me.Size.Height / 2) - (Me.GroupBox1.Height / 2))<br />
<br />
Me.GroupBox1.Location = New Point(x, y)<br />
End Sub
The height seems to be offset, but this might get you closer to your answer.
|
|
|
|
|
That did it!!
Thank you very much.
- Harold
|
|
|
|
|
The height will be offset because you have to accomodate for the titlebar(which is normally 30 pixels) and the bottom edge(which is normally 3-4 pixels).
Posted by The ANZAC
|
|
|
|
|
Thanks. Do you know of a property for the client area only?
|
|
|
|
|
Ok, i've come up with this:
Dim y As Integer = Me.Bounds.Height / 2 - Me.GroupBox1.Height / 2<br />
Dim x As Integer = Me.Bounds.Width / 2 - Me.GroupBox1.Width / 2<br />
Me.GroupBox1.Location = New Point(x, y)
This will center your control, in this case, a groupbox within the forms client area. However ther may be one drawback (depending on how you see it). If you have a docked menu at the top of your form, the control will center itself between the bottom of the form and the menu. I'm guessing the same goes for any docked menu on any side. Other than that, i think this works quite well.
Posted by The ANZAC
|
|
|
|
|
Hi,
I have to import data from .csv file (which contains 4 different columns like firstname,lastname,DOB,SSN) into Oracle database by using vb.net and asp.net(web application). This .csv file is very bulky file which may containts upto 10,000 rows.
Can any body tell me that what is the faster way to do it thru web page.
Any sample code or link is available which solve this issue than it would be very much helpful to me.
regd,
montu3377
|
|
|
|
|
Hi, I have an old laptop which is running windows xp professional. I have a problem with my keyboard that the M and N key seem not to be funtion sometime. I need to press it very hard in type M or N character.
If I work in windows, it doesn't has any problem becuase I could use the utitlity call On screen keyboard to type this character. But when I start logon or my computer is lock and need to unlock and this key is the part of my password or username, it is really make me in trouble.
From here, I would like to write my own software or find any software that attach itself to winlogon.exe which consist of small button if i could not type my keyboard they i will use this button to load an on screen keybaord or other tool that i could click on the character that I could not type. I used to use windows xp tablet pc edition and i found that Microsoft have attach the keybaord button for user to use the pen to type it.
Does anyone has any idea?
|
|
|
|
|
The winlogon.exe is a Microsoft Windows program that has the key functionality of the logon interface. I do not believe it will be possible or wise to alter or enhance the program that may leave security holes in the OS (I have know idea whether what you are thinking will or will not, but it is still a possibility). Their are some programs that I know add some functionality to the winlogon.exe program to customize the interface or add alternative login forms (examples: fingerprint reader or LogonStudio from a Windows Skinning company), but I don't know how exactly they do it.
It may be easier to just change the password or username. Or for that matter get a new keyboard if the keyboard is really interfering with your productivity.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Thank you very much for your suggestion. I think I might use automatic logon when my keyboard came to normal. I can't purchase an external keyboard because sometime I need to make a presentation with this laptop on the road.
Thank again for your suggestion. Happy new year!!!
|
|
|
|
|
It's a heck of a lot easier to replace the keyboard or just buy ($10 US) a normal desktop keyboard and plug that into the laptops keyboard port.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|