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.
UKnod 16 Newbie Poster
Recommended Answers
Jump to Post— TnTinMN 418For 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
TnTinMN 418 Practically a Master Poster
UKnod 16 Newbie Poster
TnTinMN 418 Practically a Master Poster
UKnod 16 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.