
masj78
Avatar/Signature-
Posts
31 -
Joined
-
Last visited
masj78's Achievements
Newbie (1/14)
0
Reputation
-
Warning before using CDO! If needed I have a copy of the Outlook 98 cdo.dll that I can email. However I would think carefully before using CDO to build any email interfaces. The reason is that clever Microsoft introduced a security clause, which prevents access to address book and sender field. So if you need to get the From field in emails to use in your work or access to addresses in yours or others address books, its a no go. Would suggest using the other 2 forms of CDO, though I am not sure if they have sucome to the same fate and don't know how to use them myself.:mad:
-
Many Thanks for the advice. I have chosen to use the RTB methods, which has taken a fraction of the code and saves the files with no loss of formating: Private Sub cmdSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSave.Click SaveFileDialog1.Filter = "Text files(*.doc)|*.doc" SaveFileDialog1.ShowDialog() emailText.SaveFile(SaveFileDialog1.FileName,OpenMode.Output) End Sub cheers!
-
I have written a routine to save text from a RichTextBox to a file. The text is taken from Outlook and contains the original formating. However I am loosing the formating when saving it to a .TXT file and wondering if its possible to ajust my code to save it as a .DOC instead. (would save an extra cut and paste into Wordpad/Word or openwith ....) My code is as follows: SaveFileDialog1.Filter = "Text files(*.txt)|*.txt" SaveFileDialog1.ShowDialog() If SaveFileDialog1.FileName <> "" Then FileOpen(1, SaveFileDialog1.FileName, OpenMode.Output) PrintLine(1, RichTextBox1.Text) FileClose(1) End If Many Thanks!:rolleyes:
-
Cheers for the help, but still having problems. Both methods look logical. Passing reference in a method or constructor, but still gives a null system reference error. Damn! This is frustrating. In the first method, the line its complaining about is: Public objSomeMethods As SomeMethods = New SomeMethods(Me) In the second method, the line below is giving a syntax error as needing a declaration: SomeMethods.objForm1 = Me Hopefully we will get there somehow!
-
Many Thanks. Works Perfect! :)
-
I am trying to find a way of refreshing the listview contents when I press a button, but not having much joy. Have tried ListView.clear, but this takes away the columns and nothing is displayed. There is a refresh and update method, but not sure how to use these. Any Ideas!
-
Do you know the best way to do this? I know how to do it in Java Controller cObj = new Controller(this); Model mObj = new Model(this, cObj); Above in Java with 2 class instances Controller and Model; to link the model to controller you pass in an instance parameter of the controller into the model object.
-
I am new to VB.NET and unsure of the way this works. I have a form with a variety of controls and to keep things nice and neat I have written some sub routine methods in another class vb file for the form to perform. The class with the sub routine methods in has references to controls on the form. I assumed if you create a link as I have done below and the methods are public then I could reference the methods from the form class. However when I do it this way I get a null reference error and if I add new to the linking instances it gives me a stack overflow error. My code is as follows: Public Class Form1 Public objSomeMethods As SomeMethods objSomeMethods.method1() objSomeMethods.method2() End Class Public Class SomeMethods Public objForm1 As Form1 public Sub method1() objForm1.buttonaction End Sub Public Sub method2() objForm1.buttonaction End sub End Class Can someone explain the proper way of going about this as I am a bit confused. Many Thanks!
-
Well I am storing ordinary text in a notepad text file. Deleting the file and re-creating it is one solution that I will try, cheers! Ideally I need to read past the file till -1 and then backupspace to the start of the file.
-
Hi All, Does anyone know if its possible to delete the contents of a text file. I am using stream reader/writer to try and store program settings, and need some way of removing the settings already in place if the user decides to change them. cheers!:confused:
-
StreamReader/Split Function Problem!
masj78 replied to masj78's topic in Directory / File IO / Registry
Will do! Cheers! Didn't notice that! -
StreamReader/Split Function Problem!
masj78 replied to masj78's topic in Directory / File IO / Registry
A star yet again! Both methods work, although as you mentioned; method 2 is a bit neater. I had a feeling the Do Loop and until clause was a bit dodgy and the ReadToEnd function was only needed, but wasn't sure which of the 2 was the cause. Thanks again! -
I am using the Split Function to make a String array of the contence of a text file(array of words). I am reading the file using StreamReader. The problem occuring is that the first String object in the Array, which is the first word of the text file is missing its first letter. Example contence of the file is: This is a test! The 'This' word gets put into the first array position as 'his', and all the other words are complete with no letters missing. My code is as follows: Dim fileRead As New IO.StreamReader("C:\store.txt") Dim store As Array Do Until (fileRead.Read = -1) strRead = fileRead.ReadToEnd strRead.ToString() store = Split(strRead, " ", -1) Loop reading out store(0) gives 'his' Any ideas anyone!
-
cheers for that. In the end I used the mouse up control and a getter to obtain the field being clicked in the ListView and the .text property as you mentioned to get the contence of the field. Found the method on an example from the MSDN section of Microsofts site.
-
Displaying Contents of Inbox With ListView??
masj78 replied to masj78's topic in Interoperation / Office Integration
I have solved this in another forum. The ListView does not allow different variable types to co-exist together. The only variable type accepted is 'String'. The first item and subitem are both of type String. The 'time received' subitem I was trying to add is of type 'Variant'. What was needed was to cast it to a String, which is of course simple; As follows: .SubItems.Add(objMessage.TimeReceived.ToString) Job Done!