Public Sub WriteWorkPointsToCSV() ' Get the filename to write to. Dim strFilename As String Dim oFileDialog As FileDialog Call ThisApplication.CreateFileDialog(oFileDialog) With oFileDialog .Filter = "csv File|*.csv" .FilterIndex = 0 .ShowSave strFilename = .Filename End With ' Make sure a filename was specified. If strFilename = "" Then Exit Sub End If Dim oDoc As PartDocument Set oDoc = ThisApplication.ActiveDocument ' Open the file to write to. Open strFilename For Output As #1 ' Iterate through the workpoints in the document, skipping the base workpoint. Dim oWorkPoints As WorkPoints Set oWorkPoints = oDoc.ComponentDefinition.WorkPoints Dim i As Integer For i = 2 To oWorkPoints.Count Dim oWP As WorkPoint Set oWP = oWorkPoints.Item(i) Print #1, oWP.Name & "," & Format(oWP.Point.X, "0.000000") & "," & _ Format(oWP.Point.Y, "0.000000") & "," & _ Format(oWP.Point.Z, "0.000000") Next Close #1 MsgBox "Saved workpoint coordinates to """ & strFilename & """" End Sub