|
You may not have sufficient rights. Try to run this code under an account with administrative rights and it will run fine.
Tosch
modified on Thursday, September 17, 2009 8:21 AM
|
|
|
|
|
Hi all,
I want to Know if there is a built in function that takes two dates and retun full date ex(01/02/2000 - 01/01/2000 = 0/1/0)
thanks for help
|
|
|
|
|
No, because that makes no sense, 0/1/0 is not a date. You can use the datetime functions to subtract two dates and get the difference in years, months or days (and times too), but you would need to format it yourself.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
hi,
I need to generate and display a lengthy word document where the contents are generated dynamically using code(Visual Basic 6.0).
so i have used word.selection.type .
My Problem is , if the user opens word document during the dynamically generation of wrd document the contents are printed in the opened document (ie current selection gone to the newly opened document by the client)
what to do
|
|
|
|
|
Your solution could be found in the following steps:
1. forget VB6
2. forget VB6 again
3. Download Visual Studio 2008 Express from Microsoft (it's free)
4. Create an example word document with all the necessary formatting and elements.
5. Save the document as an xml document
6. Open the xml document with Visual Studio
7. Use Visual Studio to create an empty copy of the xml document into a string and then fill in the dynamic content.
8. Save the string into a file, and save the file as [YourFileName].doc
This is just one possible solution. But I do warmly recommend to follow steps 1 and 2 at any rate.
My advice is free, and you may get what you paid for.
|
|
|
|
|
Sorry, I didnt understand the 6 and 7 th point. i dont have much idea in Visual Studio 2008 .
one more clarification:
I have to bring to work only by using Visualbasic 6.0..is this will provide the solution to work with vb 6.0
|
|
|
|
|
The basic idea is to build a string, and save it to a file.
Point 6 can also be done with a (free) text editor like for example PSPad[^]
Point 7 can also be done in VB6. Look at what the xml file looks like, and have your code build a string exactly like it. So for example:
Dim MyFileContent As String
MyFileContent = "<someXMLelement>Some dynamic content here </someXMLelement>"
In the end the file will be built in memory, so it can not be accidentally opened while it is still being written.
This gives you some added advantages:
- You will able to run your application, and write the documents, on a PC or server without needing MS Office.
- This method will make the document version independent, so a user can open it, no matter which version of MS Office they have.
- You could build in some email functionality, and send the document to someone's email instead of storing it.
- Or you could instead store the document on a server or network storage media, so you won't have to install your application on each user's PC separately.
Finally, you really need to consider why your work wants you to use VB6. There are no good reasons. Anything that it can do, can be accomplished much easier with VB.NET. The editor (Visual Studio 2008 Express) for VB.NET is free, and makes writing code 100 times easier, compared to whatever editor you use to write VB6 code. It is much much easier to debug, and it will take you 2 weeks tops to get used to.
VB6 is outdated, not supported anymore by Microsoft, and you will not find many people who can help you with it.
My advice is free, and you may get what you paid for.
|
|
|
|
|
Hello all
My project will be run with a tought screen and am trying to make a keyboard in vb
can anyone guide me in the right direction i search on google and did not fin anyting helpfull
Thanks
|
|
|
|
|
I've done this before. Basically, I took a graphic of a keyboard, brought it up whenever the user focused on a textbox ( I used a derived class to do this ), and passed the textbox that had the focus whenever the keyboard came up. Then whatever you pressed, I passed on to the textbox. The main thing is to remember to support backspace and delete. You can add a key to clear it, too, if you think that makes it easier to use.
What touch screens do you use, out of curiosity ? HP has some sweet ones now.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I dont remeber what kind of touch screen i have i got it out of a cafe its a 15" lcd works good I will look at the hp screens i want to get a bigger one
do you have a sample of code to get me started ?? Please
Thanks
|
|
|
|
|
I was planing on using a bunch of button and putting code in each one for each letter
|
|
|
|
|
Well, I can't give you the code, b/c I don't own it, my work does. But rather than a bunch of code at the button level, what I did was find a single graphic of a keyboard, and created a map of rectangles that represented each key. On a mouse down event, I would iterate over those rects and find the one that contained the point. Then I'd look up what key that represented and go from there.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I already have pictuers for each button and i already did the layout
I tryed this
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
SendKeys.Send("W")
End Sub
and this
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Button1.Text = ("W")
End Sub
did not work
i put the curser in the text box and it go away when i click the buttin
|
|
|
|
|
Bob Beaubien wrote: i put the curser in the text box and it go away when i click the buttin
After the button click you can focus to text box which will bring the cursor back to it.
Bob Beaubien wrote: I already have pictuers for each button and i already did the layout
Putting each button for each key sounds like a terrible idea. Go with what CG suggested. That would be interesting and obvious solution here.
|
|
|
|
|
Bob Beaubien wrote: SendKeys.Send("W")
This is a nightmare. Make your control hold a reference to a textbox, and then add the character explicitly, not with sendkeys or other dodgy stuff.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I am lots now hehe i am going have to do some more looking up
|
|
|
|
|
lost ? OK, well, you have a public property of type textbox. It gets set to whatever textbox has the focus. You do this by creating a derived class, which, when it gets the focus, passes itself to the static keyboard object. Then in your code, you use the text property of that control to insert the text.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Would making a custom IME helps?
The other way is go deep into Win32 API and lotsa hooking and hacking.
Pals of mine did the Tengo keyboard on tablets, though I am not so sure what did they used. I only did the Palm version, but I am sure the Windows Mobile version are in C++.
http://www.gadgetme.com/?view=1&showMore=2449[^]
|
|
|
|
|
Hello i have question how to make something like this : CIMDBSearch Class[^]
But in vb8 or .net ... Thanks for reply .
|
|
|
|
|
Apparently, his class created a URL according to IMDB's specifications and retrieved the movie page from the website. It then parsed the web page HTML to pull out the relevant information and filled in a search research object which is returned to the caller.
|
|
|
|
|
Thanks for reply , but i dont know how to code it .. Can you give me example pls ? Thank you
|
|
|
|
|
I don't have any examples that would be anywhere close to this. You just ahve to break down the problem into smaller units and work on each of those individually. Each one of these units is going to have an example somewhere. This is where you're most important skill as a programmer comes into play - the ability to do research and teach yourself new things. I've already told you the steps needed, it's up to you to break those down into smaller managable pieces and tech yourself the techniques of each.
|
|
|
|
|
The article has comments about it not working, so it probably isn't the best choice. However, the sequence of events is quite simple. Get the web page source, and apply a regex to it. The former is simple, the second needs some research. Try this website for help on that.
|
|
|
|
|
Thanks for reply , but i dont know how to code it .. Can you send me example pls ? Thanks so much
|
|
|
|
|
No one will flat out do your work for you, perhaps you should pick up a book and give it a shot.
|
|
|
|