Save contents of the schedule as a GIF

Y

Yohan

Here is what I'm trying to do: Filtering the schdule by date range and
then showing it by resource. After that I want to save it to a disk as
a GIF file by resource name. I was able to loop throw the resource and
filter it by date range succefully. but when I want to save the output
as a Gif file its not working!! Is there a way to save whatever on the
ms project screen to a file? here is my code


Sub Macro1()

Dim r As Resource
Dim mystring As String

For Each r In ActiveProject.Resources
If r.Assignments.Count > 0 Then
mystring = r.Name

SelectAll
ZoomTimescale Selection:=True

FilterEdit Name:="Date &Range...", TaskFilter:=True, Create:=True,
OverwriteExisting:=True, FieldName:="Start", test:="is greater than or
equal to", Value:="08-25-2008", ShowInMenu:=False,
ShowSummaryTasks:=True
FilterEdit Name:="Date &Range...", TaskFilter:=True, FieldName:="",
NewFieldName:="Finish", test:="is less than or equal to",
Value:="09-05-2008", Operation:="And", ShowSummaryTasks:=True

FilterApply Name:="Date &Range..."

FilterEdit Name:="Resource", TaskFilter:=True, Create:=True,
OverwriteExisting:=True, FieldName:="Resource Names", test:="equals",
Value:=mystring, ShowInMenu:=False, ShowSummaryTasks:=True
to", Value:="08-31-2008", Operation:="And", ShowSummaryTasks:=True

FilterApply Name:="Resource"

MsgBox (r.Name)

EditCopyPicture forPrinter:=pjGIF, FileName:="C:\" & r.Name &
".gif"



End If
Next r

End Sub
 
R

Rod Gill

Hi,

By recording a macro of me creating a gif file and a quick read of help to
reduce the number of options I came up with:

EditCopyPicture Object:=False, ForPrinter:=pjGIF, FromDate:="20/08/08
12:00 a.m.", ToDate:="5/10/08 12:00 a.m.", _
FileName:="C:\Users\Public\@ProjectSystems\Temp\Delete me.gif"

So, just use the Using Resource Filter and use the dates in the
EditCopyPicture method for the date range. Read help on the method as there
are extra things you can do re scaling the image etc.

--

Rod Gill
Microsoft MVP for Project

Author of the only book on Project VBA, see:
http://www.projectvbabook.com
 
Y

Yohan

Hi,

By recording a macro of me creating a gif file and a quick read of help to
reduce the number of options I came up with:

    EditCopyPicture Object:=False, ForPrinter:=pjGIF, FromDate:="20/08/08
12:00 a.m.", ToDate:="5/10/08 12:00 a.m.", _
        FileName:="C:\Users\Public\@ProjectSystems\Temp\Delete me.gif"

So, just use the Using Resource Filter and use the dates in the
EditCopyPicture method for the date range. Read help on the method as there
are extra things you can do re scaling the image etc.

--

Rod Gill
Microsoft MVP for Project

Author of the only book on Project VBA, see:http://www.projectvbabook.com


















- Show quoted text -

Thanks a lot. Let say you have more than one page on the tif file.
does EditCopyPicture generates one file with all of the pages? if yes,
how. Could you recommend a URL where i can look at . this is my first
code in VBA
 
R

Rod Gill

By default the picture is only of visible tasks. Select Tasks you want
pictured if they are more than what's visible and set the relevant
parameter.

If the picture needs to be limited to a certain size, enter that size and
specify how you want the image scaled. See help for details on all these
options.

--

Rod Gill
Microsoft MVP for Project

Author of the only book on Project VBA, see:
http://www.projectvbabook.com



Hi,

By recording a macro of me creating a gif file and a quick read of help to
reduce the number of options I came up with:

EditCopyPicture Object:=False, ForPrinter:=pjGIF, FromDate:="20/08/08
12:00 a.m.", ToDate:="5/10/08 12:00 a.m.", _
FileName:="C:\Users\Public\@ProjectSystems\Temp\Delete me.gif"

So, just use the Using Resource Filter and use the dates in the
EditCopyPicture method for the date range. Read help on the method as
there
are extra things you can do re scaling the image etc.

--

Rod Gill
Microsoft MVP for Project

Author of the only book on Project VBA, see:http://www.projectvbabook.com


















- Show quoted text -

Thanks a lot. Let say you have more than one page on the tif file.
does EditCopyPicture generates one file with all of the pages? if yes,
how. Could you recommend a URL where i can look at . this is my first
code in VBA
 

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