There are many ways to export it. What format do you want it in and which
fields specifically do you want to export?
Here is some sample code which exports information about all the tasks into
a text file. It can easily be customized to write just about any project
information. Let me know if you need any help with it.
Sub NoteFile()
Dim mystring As String
Dim MyFile As String
Dim fnum As Integer
Dim myTask As Task
'set location and name of file to be written
'this writes to a text file at the root directory of the c: drive
MyFile = "c:\" & ActiveProject.Name & "_Project_Notes" & ".txt"
'set and open file for output
fnum = FreeFile()
Open MyFile For Output As fnum
'Build string with project info
mystring = ActiveProject.Name & " " & ActiveProject.LastSaveDate & " " &
Application.UserName
'write project info and then a blank line
Write #fnum, mystring
Write #fnum,
'step through tasks and write notes for each then a blank line
For Each myTask In ActiveProject.Tasks
If myTask.Notes <> "" Then
'edit the following line to include the fields you want, use " " to
include any text or spaces.
mystring = myTask.UniqueID & ": " & myTask.Name & ": " &
myTask.Notes
'Some other Examples: MyString = MyTask.Text1 & ": " & MyTask.Start
Write #fnum, mystring
Write #fnum,
End If
Next myTask
Close #fnum
End Sub
-Jack
karen said:
Hello all:
I am wring VB to extract text from a project file.
Right now I got the text by hard coding each column in task, resource and resource address book.
I am wondering if there is a better way, like check all available columns
and use a loop to traverse all column and extract the text in each column.