Identify if Summary and note in another column

J

JackD

There wasn't one. This is why it was added.
I think I have mentioned before that working from a table is a poor idea as
it is easy to change the table and thus not get the report that you wish.

The better approach is to simply export the fields that you know you want in
the order you want. That way the export will always work even if your user
has chosen a different table or changed the one you want them to use.
So I'd do something like the following:

Dim Path, header, tData As String

Path = "c:\Documents and Settings\All Users\Desktop\headers.txt"
Open Path For Output As #1
header = "Task Name: " & "Duration: " & "Start: " & "Finish: " & CrLf
Write #1, header;
for each task in activeproject.tasks
tData = task.name & ", " & task.duration & ", " & task.start & ", " &
task.finish & CrLf
Write #1 tData
next task
Close #1

Of course to be really useful, I prefer to export into excel.
 
J

JackD

Why are the fields going to be different with each project?
I can't think of any reason to use different fields for each project.
It is to your advantage to use fields consistantly.
 
D

dew

I think I now have code that works. I just need it tested on 2000 to be sure.

Sub CopyHeaders()

Dim ColCount As Integer
Dim Path, header As String

Path = "c:\Documents and Settings\All Users\Desktop\headers.txt"
Open Path For Output As #1

SelectRowEnd
LastField = ActiveCell.FieldName

SelectBeginning

Do Until header = LastField
header = ActiveCell.FieldName
Write #1, header;
SelectCellRight
Loop

Close #1

End Sub
 
J

JackD

Looks like it should work. I don't have 2000 installed so I can't help you
check it, but Good luck!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top