Re: How to extraxt text from microsoft project files?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: JackD (see)
Date: 06/25/04


Date: Fri, 25 Jun 2004 14:09:32 -0700

To extract data from a column (actually the column is just where a FIELD is
displayed so I'm going to call it a field from here) you need to tell your
code which field to use. So if you want to get the name of a task you would
get the value of task.name. For the start date of the task you would get the
value of task.start.

The data from the fields can be extracted through vba whether the column is
displayed or not.

If you want a really simple way to do this, just go to file menu, select
save as and for the file type select text file.
It will walk you through the process of creating a map where you choose
which fields you want to export.
Every project file has the same set of fields. They may look different
because the columns which display the fields are different, but the fields
are the same for all.

-Jack

"karen" <karen@discussions.microsoft.com> wrote in message
news:516766C8-C812-452D-BF89-2B97A00F6C8C@microsoft.com...
> Hello Jack:
>
> Thank you very much. I appreciate your advices. while the problem is
that I don't know what columns are in the file. I got the file and run it
in VB that gives me a .txt file with all information the project file has.
It is the VB program who detects the project files and gets the column
numbers and extract the text from those columns. Any idea on that?
>
> Thanks
>
> Karen
>
> "JackD" wrote:
>
> > 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" <karen@discussions.microsoft.com> wrote in message
> > news:51985402-6A71-4C1D-97DB-879C5A777BA2@microsoft.com...
> > > 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.
> > >
> > > Any suggestion is appreciated.
> > >
> > > Thanks
> > >
> > > karen
> >
> >
> >



Relevant Pages

  • Re: How to extraxt text from microsoft project files?
    ... > There are over 200 fileds for either tasks or resources, ... >> Every project file has the same set of fields. ... >> because the columns which display the fields are different, ... >> numbers and extract the text from those columns. ...
    (microsoft.public.project.vba)
  • Re: How to extraxt text from microsoft project files?
    ... "JackD" wrote: ... > because the columns which display the fields are different, ... > in VB that gives me a .txt file with all information the project file has. ... > numbers and extract the text from those columns. ...
    (microsoft.public.project.vba)
  • Re: Creating a Macro
    ... Dim vFindText As Variant ... Extract ?5 needs to be 5 then the symbol ... Word MVP web site http://word.mvps.org ...
    (microsoft.public.word.docmanagement)
  • Re: How do I save data from a Word 2007 form with non-legacy contr
    ... Put all the forms from which you wish to extract the data in a separate ... Pick the folder containing the forms from the macro dialog. ... Word MVP web site http://word.mvps.org ... Dim DocList As String ...
    (microsoft.public.word.docmanagement)
  • VBA code to extract m-coefficient in linear trendlines from ALL charts
    ... online used to extract all coefficients from the trendline textbox. ... trendlines in however many charts I may have in the sheet. ... Dim sStr As String, sStr1 As String ...
    (microsoft.public.excel.misc)