|
I've used this[^] library before. It's pretty good and gives you all the control you want.
RageInTheMachine9532
|
|
|
|
|
First, sorry for reposting this again (previous post)[^], however I have had not much luck researching this one, so I just want to ask for tips/hints on this matter.
The problem:
I need to set the stapling capability of a printer before printing a document (in a Word global template, i.e. VBA code).
I have found an API to set printer duplexing, which unfortunately does not include setting the stapling.
I've had a look at PDL (Page Description Language) but I find that it will be too complex to put the PDL command on top of the document file before printing it out.
If anyone has ever done this before can you please inform me on how to set printer stapling?
Thanks,
Edbert P.
Edbert P.
Sydney, Australia.
|
|
|
|
|
I can't find a single code example (in any language) that even comes close to what you want. The only example I could find is buried inside driver code, which won't help you because your not doing the actual job assembly and printing.
There are a couple of problems:
1. You need to set the stapling in PageSetup of the document before it is printed. This will not be accomplished using the API calls. What you've been looking at is setting the default for the printer for ALL documents being printed by ALL applications.
2. Since not all printers support stapling and the ones that do require you to send different data structures to enable stapling, coding this is going to be a GIANT pain.
If your doing this as a document template, you should be able to start a document, using the printer with stapling as the default printer, go into PageSetup and set everything you need to, including stapling, then setup your documents properties the way you want, then just save the template as a .DOT file. When you create a document using that template, stapling SHOULD be enabled, and not if the printer doesn't support it.
The above has NOT been tested since I don't have access to ANY printers that support stapling (rare, but cool, beasts that they are.)
RageInTheMachine9532
|
|
|
|
|
Thanks a lot for the effort (and the explanation)
I will continue searching for this and if I find anything I will post it for everyone.
Edbert P.
Sydney, Australia.
|
|
|
|
|
Has anyone seen controls/code that produces the sort of functionality provided by the "To:" text box on an Email message? In other words - clicking a button brings up a list of items to select from, one or more items are selected and appear in the text box, double-clicking one takes you back to the relevant item in whatever data source you're using, but after an event (send or whatever) the relevant data is then copied elsewhere (to the Email item or elsewhere).
|
|
|
|
|
After much searching, I haven't seen any controls that do everything you describe. Not even half of what you want, actually...
If I were in your shoes, I would write the thing myself...
RageInTheMachine9532
|
|
|
|
|
I set the form1.moveable = false when designing. But I want that the form1 could move in running. Therefore I set the form1.moveable=true in a button click events. However it cannot be done. It shows that the .moveable is readonly and cannot be changed while running. How can I make a form moveable in running while be set to unmoveable in designing?
Thanks!
|
|
|
|
|
I have to question why this would be an issue? From what I can tell, the Moveable property has no effect at design time, only at runtime. The form in the designer is locked to the upper left corner of its document window, regardless of this property. Also, you can change the position of the form using the Top and Left properties, even when Moveable is false. I don't see how that window is moveable during design-time...
RageInTheMachine9532
|
|
|
|
|
Please tell me how to use CallByName function in VB.NET.
Thanks,
|
|
|
|
|
CallByName lets you call a Function or manipulate a Property on an object, such as a TextBox or other class:
CallByName(TextBox1, "Text", CallType.Set, "New Text")
CallByName(TextBox1, "Hide", CallType.Method)
Dim col As New Collection()
' Store the string "Item One" in a collection by
' calling the Add method.
CallByName(col, "Add", CallType.Method, "Item One")
' Retrieve the first entry from the collection using the
' Item property and display it using MsgBox().
MsgBox(CallByName(col, "Item", CallType.Get, 1))
The down side to using the CallByName function is that it is very slow. There is also no type checking of arguments, so handling errors properly becomes a bit of a pain.
RageInTheMachine9532
|
|
|
|
|
(1) How can I code a text box to accept characters of the alphabet, a spacebar (and a - for double barrel names) only? Ideally this text box is named txtName and is supposed to accept people’s names.
(2) In VB. NET how can I create a library of common procedures that I will constantly need to copy and paste to different projects
Been always great to be part of this forum, especially when I know they know more than what I know…..
|
|
|
|
|
bensoncd wrote:
How can I code a text box to accept characters of the alphabet, a spacebar (and a - for double barrel names) only? Ideally this text box is named txtName and is supposed to accept people’s names.
You could run a regular expression on the contents of the textbox changing, and disable the OK button (or whatever) until the expression matches.
bensoncd wrote:
(2) In VB. NET how can I create a library of common procedures that I will constantly need to copy and paste to different projects
Try creating a Class Library project. This allows you to create a .NET assembly (held in a DLL) that can contain your common code base.
Ian Darling
"One of the few systems...which has had “no deaths” in the reliability requirements." - Michael Platt
|
|
|
|
|
I have written a programme that should allow a pupil to enter his details and then the programme will display the pupil’s profile using a dialog box. I have worked the rest fine but I have difficulty in setting the leap year limits for the month of February. I have tried juggling around my code in many different ways, but seem not to get it right. I have left the code with an array of 10 leap years that I consider to fall within a pupil’s age. I definitely know that the problem is not with coding an array, it’s something else. I have said:
For Leap year 1 To Leap year 10
If the month is "February" And CInt(The “Value” of numeric-up-down representing the pupil’s year of birth) <> Leap year And [Day is ("29") Or ("30") Or ("31")] Then
ErrorMessage1
Exit Sub
End If
If the month is "February" And CInt(The “Value” of numeric-up-down representing the pupil’s year of birth) = Leap year And [Day is ("30") Or ("31")] Then
ErrorMessage2
Exit Sub
End If
However, an error exist somehow in the code, may you give me an idea of where the problem is.
Been always great to be part of this forum, especially when I know they know more than what I know…..
|
|
|
|
|
You might want to learn what the rules for leap years are:
If the year is divisible by 4 then it's a leap year. However, if the year is also divisible by 100, then it is not, but it it's divisible by 400 then it is.
Hence 2000, 2004, 2400 are leap years, but 1900 and 2100 are not.
A leap year has one additional day, which is February 29th.
------------------
If you're using .NET, just use DateTime.Parse or something to see if the date entered is valid or not (as the DateTime APIs handle this stuff anyway, so you're better off using them). VB6 may have a similar API.
Ian Darling
"One of the few systems...which has had “no deaths” in the reliability requirements." - Michael Platt
|
|
|
|
|
I'm making a small program wich has to be used to input bills. Becuase of this, it will have to format numbers for me.
Now, for example
When I my input is 3.50 then my output has to be 3,50 AND NOT 3500!!!!!
So my question is, how do you format numbers so that the "." becomes a "," ???
<<<eRiK>>>
|
|
|
|
|
vb6 ?
Dim n
n = 3500
MsgBox FormatNumber(n, 0, , , vbTrue)
|
|
|
|
|
I think you dont get my question well... When you enter a value (for example totall bill) most people don't use a "," but a "." . But if you enter a "." in VB, he will read it as a thousand sign, so 3.50 -> 3500 . But, I want him to make a value of it so 3.50 -> € 3,50 . Eventually without the €-sign !!
I hope you could now help me better ( by the way, it has to work with textboxes and not with msgboxes!!! )
(¯`·._.·[eRiK]·._.·´¯)
|
|
|
|
|
maybe this function i made can help. this is for vb.net, hopefully thats wut ur using.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Function GetEuros(ByVal num As Double) As String
Dim tempNum As String = Format(num, "n")
tempNum = tempNum.Replace(".", ",")
Return tempNum
End Function
(...)
Dim myNum As Double = 54.25
text1.text = GetEuros(myNum)
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
this makes text1.text = 54,25.
------------------------
Jordan.
III
|
|
|
|
|
I am trying to make an application that stores and manipulates data. The problem is that I will be trying to market this application to small vendors (Strip mall stores) who cannot afford expensive SQL Server licenses.
My example is a small store (e.g. laundromat) order tracking system. Is it possible to write an application like that without using a database backend?
|
|
|
|
|
Why don't you use MS Access? It comes free with Office
1fm1fu
|
|
|
|
|
Some help, 'case u need it.. http://visualbasic.about.com/library/weekly/aa050303f.htm
1fm1fu
|
|
|
|
|
I was thinking more in the line of using files to store data but that pro'lly isnt a good solution coz of the whole locking issue with multi-users. Might as well write my own sql server. Access is a good solution but there are problems when the database size increases.
I was thinking more from a business model side of the product. Is it cost effective to defer the cost of SQL Server to the user. Maybe get a 1 seat license since only the application will be using the database? I just wanted to figure out how to price the product before i actually start working on it.
|
|
|
|
|
|
EXACTLY what i was looking for... thanks.
|
|
|
|
|
How can I change the text of a textbox in a form of a .NET application, By clicking a button
in a form of an other .NET stand alone application? I know that DDE is no longer supported
in the .NET framework. I may use XML to do that but I don't know how?
please help me
|
|
|
|