tags:

views:

30

answers:

1

Hi everyone,

I wrote the code bellow and need the asociated .PGP file to have the text http:// included. the PGP file is namely read by Autocad which requers the "http://" in its text to be able to launch the desierd webpage. problem is , is that VBA is Auto formating the http:// as a code entatie and not writting it to the text based PGP file.

can any one tell me how to achive what im after?

Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
    Dim FILE_NAME As String = "C:\test.pgp"

    If System.IO.File.Exists(FILE_NAME) = True Then
        Dim objWriter As New System.IO.StreamWriter(FILE_NAME, True)
        objWriter.WriteLine((TextBox5.Text) + "," + "     " + "START http://" + (TextBox6.Text) + ", 1,,")
        objWriter.Close()
        MsgBox("The acad.pgp file was successfully appended…")
    Else
        MsgBox("File missing reinstall or contact vendor…")
    End If
End Sub
A: 

Hm, I'tried your code above in VisualStudio 2010. An empty file named C:\test.pgp was appended with the following text:

textbox5,     START http://textbox6, 1,,

The text http... is right there. Sometimes, when I open the file in a viewer, this viewer automatically detects the http string and marks it as a hyperlink. But only in this viewer!

So the error seems to be somewhere else, not in the code?

WizzardsApprentice