|
Dim mDab as new filesystemobject
dim mtxt as textstream
dim mFile as file
dim i as integer
call mDab.createtextfile("c:\list.txt")
set mfile = mDab.getfile("c:\list.txt")
set mtxt = mfile.opentextstream(forwriting)
for i = o to listbox1.items.count-1
call mDab.writeline(listbox1.item(i))
next
call mtxtstream.close 'put this line in the private sub Form_Terminate() ok
it will solve ur problem
:->
Thanks alot
Hamody
|
|
|
|
|
How can I change an Excel worksheet column's format in vb6.
I can open an Excel app and write to it, but if I write text like "00100" it loses the 0's and becomes "100" because the column format is General. How can I change it to Text in code?
1fm1fu
|
|
|
|
|
The quick way to do it is to use "'00100" or write a quick function to append the ' to the front of the value.
Or set the numberformat property for the range then the value as below:
Dim c As Range
Set c = Worksheets("Sheet1").Range("A1")
c.NumberFormat = "@"
c.Value = "00100"
|
|
|
|
|
Thanx jonathan15, this works.
I'll try hard and convince Christine, my code tester, not to worry about the mark this makes in the cell.
1fm1fu
|
|
|
|
|
If you use the second method the only mark it will leave will be a green tab in the top left corner of the cell which is simply there to show that it is a number formatted as text. This would be there even if you used the Excel menu to format the cell.
Jonathan
|
|
|
|
|
hi all, could anyone give me a code of zipping a folder like we zip it manually using winzip program
Thanks alot
Hamody
|
|
|
|
|
take a look at Component spot. They have a pretty good one with some examples...and its free!
|
|
|
|
|
hi man, thanks alot for ur help but the site u sent me doesnt open so could u please check it, thanks again
Thanks alot
Hamody
|
|
|
|
|
It's http://www.componentspot.com[^]. All you had to do was search for "Component spot" on Yahoo or Google to find the correct URL.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi man the site u sent me gives a trial versions of a programs but i need a code to add in my project so could u plz plz plz plz help me in getting this code
Thanks alot
Hamody
|
|
|
|
|
I don't know who the Anonymous poster is, it wasn't me. All I did was supply a fixed link.
You might want to try #ZipLib[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
ok man i tried it, but now am looking for a code that zip a folder not just a file as a site code gives, and i would like to ask u for another help if u can which is how i can save email message as msg file format i need a code man so could u plz plz help me
Thanks alot
Hamody
|
|
|
|
|
Don't know. I've nver had to use any .ZIP library in any of my code.
Mohammad Bassam Daba`an wrote:
how i can save email message as msg file format i need a code man so could u plz plz help me
Can't help there. I don't know the Outlook object model well enough.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi i want to ask u for another thing also plz...
i want to insert any file format into a rtf do u know the cade of this important thing.
Thanks alot
Hamody
|
|
|
|
|
Don't know that one either. But it's been asked on the Forums before an, IIRC, it's not easy. There are no .NET Framework methods that expose this functionality so you'll have to call into the control directly and into the Win32 API to get this to work. You might want to try reading Use IRichEditOle from C#[^] by John Fisher first before you decide to tackle this project.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
ok man but i tried it before it is not enough, thanks alot for trying helping me but am searching on this point since 2 months so i gonna be crazy from this point i dont know how i can get the solution
Thanks alot
Hamody
|
|
|
|
|
hi, could u plz help me in another problem
i want to make the treeview to be right to left, i use vb6.0
i neeeeeeeeed help
Thanks alot
Hamody
|
|
|
|
|
hi could anyone give me a code of saving the email message as MSG file format i need a code plz any help
Thanks alot
Hamody
|
|
|
|
|
Here is a VC++ dll which should pass several results.
How to define the parameter?
Just like Windows API?
|
|
|
|
|
What C++ .DLL? What function call are you talking about? What parameter?
This process process is no different than calling a Win32 API function, which are just other C++ .DLL's.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have solved the problem.
Thanks.
|
|
|
|
|
In VB.NET
2 part question:
I want a DataRow that contains a column with a specified value.
Part 1: would the following work to identify the row that contains the value and assign it to the DataRow?:
drPart = DsParts1.Tables("EventID").Rows.Find(iEventId)
‘where EventID is the column and iEventId is the value.
Part 2: Once I have identified the row with the value and assigned it to drPart, how do I assign the index of that row in the table to iIndex variable?
Thanks.
|
|
|
|
|
1. Will work only if the value you are searching for is in your PrimaryKey column. If not use the DataTable.Select function. You can even use complex queries there.
2. I think there is no elegant way to get the index. If your really need it you will have to determine it yourself:
public int IndexOf(DataRow row, DataTable table) {
for (int i = 0; i < table.Rows.Count; i++)
if (table.Rows[i] == row)
return i;
return -1;
}
Note that this is not very effective and should not be used with large DataTables.
|
|
|
|
|
Thank you, Robert.
I have been working on it and between two VB.NET books I was able to figure out how to use select method to form a subset. You are right about using select, it was much simpler than what I had originally thought to do. I was going to use the index (if it existed) and move through the data table to find the rows I wanted.
|
|
|
|
|
Imports System.IO
Imports System.Collections
Imports System.Runtime.Serialization.Formatters
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents Button2 As System.Windows.Forms.Button
<system.diagnostics.debuggerstepthrough()> Private Sub InitializeComponent()
Me.Button1 = New System.Windows.Forms.Button
Me.Button2 = New System.Windows.Forms.Button
Me.SuspendLayout()
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(24, 192)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(104, 32)
Me.Button1.TabIndex = 0
Me.Button1.Text = "Button1"
'
'Button2
'
Me.Button2.Location = New System.Drawing.Point(160, 192)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(96, 32)
Me.Button2.TabIndex = 1
Me.Button2.Text = "Button2"
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(292, 266)
Me.Controls.Add(Me.Button2)
Me.Controls.Add(Me.Button1)
Me.Name = "Form1"
Me.Text = "Form1"
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim vendor As company = New company
Dim buyer As company = New company
Dim goods As lineitem = New lineitem
Dim po As purchaseorder = New purchaseorder
vendor.name = "acme inc."
buyer.name = "wiley e. coyote"
goods.description = "anti-roadrunner cannon"
goods.quantity = 1
goods.cost = 599.99
po.items(0) = goods
po.buyer = buyer
po.vendor = vendor
Dim sf As Soapformatter = New soapformatter
Dim fs As FileStream = File.Create("c:\po.xml")
sf.serialize(fs, po)
fs.close()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim sf As soapformatter = New soapformatter
Dim fs As FileStream = File.OpenRead("c:\po.xml")
Dim po As purchaseorder = CType(sf.deserialize(fs), _
purchaseorder)
fs.close()
MessageBox.Show("customer is " + po.buyer.name)
End Sub
End Class
Public Enum purchaseorderstates
ISSUED
DELIVERED
invoiced
PAID
End Enum
<serializable()> Public Class company
Public name As String
Public address As String
Public phone As String
End Class
<serializable()> Public Class lineitem
Public description As String
Public quantity As Integer
Public cost As Double
End Class
<serializable()> Public Class purchaseorder
Private _purchaseOrderStatus As purchaseorderstates
Private _issuancedate As DateTime
Private _deliverydate As DateTime
Private _invoicedate As DateTime
Private _paymentdate As DateTime
Public buyer As company
Public vendor As company
Public reference As String
Public items() As lineitem
Public Sub New()
_purchaseOrderStatus = purchaseorderstates.ISSUED
_issuancedate = DateTime.Now
End Sub
Public Sub recorddelivery()
If _purchaseOrderStatus = purchaseorderstates.ISSUED Then
_purchaseOrderStatus = purchaseorderstates.DELIVERED
_deliverydate = DateTime.Now
End If
End Sub
Public Sub recordinvoice()
If _purchaseOrderStatus = purchaseorderstates.DELIVERED Then
_purchaseOrderStatus = purchaseorderstates.invoiced
_invoicedate = DateTime.Now
End If
End Sub
Public Sub recordpayment()
If _purchaseOrderStatus = purchaseorderstates.invoiced Then
_purchaseOrderStatus = purchaseorderstates.PAID
_invoicedate = DateTime.Now
End If
End Sub
End Class
|
|
|
|