Print from VBA

T

tk

I am able to print from a macro using ViewApply Name:="&Gantt Chart" and
FilePrint. Is there a way to filter by resource before I print? I need to
loop through each resource and print each ones schedule seperately. Any
help would be appreciated.

Thanks
 
T

tk

Here is the code that I am using:

Dim i As Integer
ViewApply Name:="&Gantt Chart"
For i = 1 To Projects(1).Resources.Count
If Left(Projects(1).Resources(i).Name, 4) = "C001" Or
Left(Projects(1).Resources(i).Name, 4) = "C002" Then
FilterApply Name:="&Using Resource...",
Value1:=Projects(1).Resources(i).Name
FilePrint 1, , , , , Date, Date
End If
Next i

When I run the code, all I get is C001 printed out, not C002 also. Is there
something else I need to be doing?

Thanks
 
J

Jan De Messemaeker

Hi,

Sorry to disappoint you (or congratulate you?) but this code works for me!
 

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