Jump to content
Xtreme .Net Talk

masj78

Avatar/Signature
  • Posts

    31
  • Joined

  • Last visited

Everything posted by masj78

  1. Seems to have worked fine. Maybe I was not waiting long enough to let it write. Will only seem to allow one word to be added though and then causes an error on the second added. If the program is ended and restarted it overwrites the single word in the file with the new one. Added a carriage return but no luck. Looks like lots of work still to be done here. Have seen a another post somewhere about overwriting. Thanks for the help so far everyone!
  2. Will try your suggestion dynamic_sysop and report back Cheers. This way is similar to reading to files in Java, which I have done a lot. I new it would end up being something like that. Dim fileName As New IO.StreamWriter(New IO.FileStream("C:\store.txt", IO.FileMode.OpenOrCreate)) Here goes! :-\
  3. Have tried as you suggested flushing the Stream contents to the file, as I can see is needed when I re-read up on StreamWriters. I also added the 'Imports System.IO' to general decs and edited the StreamWriter to: Try Dim fileName As New _ IO.StreamWriter(File.Open("C:\store.txt", FileMode.Open)) strStore = storeText.Text ' Text from text box fileName.Write(strStore) ' write input to file MsgBox(strStore & " has been stored!") ' message has stored fileName.Flush() fileName.Close() ' close file fileName = Nothing Catch ex As Exception MsgBox("Error Opening File!") End Try File is still blank though and I don't know why. I have followed book advice but still not working. Ahhhhhhhhh!!!!!! Help!
  4. I am taking input from a text box and trying to write to a blank .txt file I already have saved on my C:\ drive, with the following: Dim fileName As New System.IO.StreamWriter("C:\store.txt", True) Dim strStore As String ----------------------------------------------------------------------------- Private Sub cmdStore_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdStore.Click Try strStore = storeText.Text ' Text from text box fileName.WriteLine(strStore) fileName.Close() Catch ex As Exception MsgBox("Error Opening File!") End Try End Sub The store.txt file is still blank, What am I doing wrong?:confused:
  5. Thanks for that! What I needed instead of: Dim nodStore AS MSComctLib.Node was the declaration: Dim nodeStore As New System.Windows.Forms.TreeNode Worked a treat. Any one reading this who needs to know how to expose the OutLook Info Stores, feel free to get in touch.
  6. Using CDO Library 1.21 and VB.NET I am trying to create in my Application the Root folder view of Outlook, using a TreeView. My variables are as follows: Dim objStore As MAPI.InfoStore Dim objFolder As MAPI.Folder Dim nodStore AS MSComctLib.Node The system does not seem to recognise MSComctLib.Node as a recongnisable object. I am assuming that this declaration is to create a root node to add the folders. It may be a function of VB6 as I am using a CDO programming book example which uses VB to guide me. I am not sure how to create the root node correctly in VB.NET. Any IDEAS anyone Cheers Mike Jones
×
×
  • Create New...