Although the program still run fine I am getting a little tired of the warning on my program that I can't get rid of. First one is with a process: Dim NewProcess As Process = New Process If Attachment2TextBox.Text <> "" Then NewProcess.Start(Attachment2TextBox.Text) Here is the warning: Warning 5 Access of shared member, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated. It gives me the warning on the NewProcess.Start I dont know how else I can use a process! The second is using the word interface: Dim oDoc As Word.Document oDoc.Bookmarks("FirstName").Range.Text = FirstNameTextBox.Text heres the warning: Warning 6 Variable 'oDoc' is used before it has been assigned a value. A null reference exception could eesult at runtime. Once again how can I give oDoc a value at dimention? Makes no sense to me any how would be apreciated.
Jump to Post
For you first question regarding Process. "Process.Start" is a shared function that returns the started process. The correct syntax would be:
Dim NewProcess As Process ' No New keyword If Attachment2TextBox.Text <> "" Then NewProcess = Process.Start(Attachment2TextBox.Text)
For you second question, I am not going to …
All 4 Replies
Be a part of the DaniWeb community
We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.