Message 1 of 6
why does it not finish create the Txt file ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have this code this should write all the part number into an part files .. but for some reason it stop in the middle or it. antone know why and how to fix it ?
Sub Main() oWrite = System.IO.File.CreateText(ThisDoc.PathAndFileName(False) & ".txt") Dim oAsmDoc As AssemblyDocument oAsmDoc = ThisApplication.ActiveDocument Dim oRefDocs As DocumentsEnumerator oRefDocs = oAsmDoc.AllReferencedDocuments Dim oRefDoc As Document Dim wrongDisplayname As String For Each oRefDoc In oRefDocs Try debug("1") oWrite.WriteLine(iProperties.Value(oRefDoc.DisplayName, "Project", "Part Number") ) wrongDisplayname = wrongDisplayname & vbLf & vbLf & " " & oRefDoc.FullDocumentName.ToString Catch End Try Next MessageBox.Show(wrongDisplayname, "Title") End Sub Public Sub debug(txt As String) Trace.WriteLine("NTI : Colour " & txt) End Sub
it stop in the midle off one