Project Interface

K

Kiro

Hello,

I have built a multiple project resource pool (and a 'master' project
to show an overview of start/finish times for all projects).

I want to know if it is possible to build or link another program to
MS Project to create some form of Interface over this, i.e.
background colours, buttons (macro's) to link from project to
project, hyperlinks etc.

Im not sure if its at all possible through any means....im just
wanting to create some kind of Interface over the normal MS Project
view. If anyone knows anything at all about this I would be very
grateful if you could help me.

Thanks very much :)
 
E

Earl Lewis

Kiro,

As you probably suspect you can do just about anything you want with software, given enough time and the right tools. Yes, there is an API and you can save projects in data formats that are readily accessible from other technologies. A few of the questions you really need to answer before you embark on that journey are:

Who are the users of this "interface"?
What do they want?
What am I trying to accomplish?
What tools and skills do I have at my disposal to do this?
How much time do I have to do this?
Are there tools already built that I can leverage?

Short answer to your question: Yes.
Long answer to your question: Answer all of the above questions to see how realistic it really is.

Why wouldn't you want people to just use the tools that are already built for the job? i.e. MS Project!

Good luck!

Earl
Hello,

I have built a multiple project resource pool (and a 'master' project
to show an overview of start/finish times for all projects).

I want to know if it is possible to build or link another program to
MS Project to create some form of Interface over this, i.e.
background colours, buttons (macro's) to link from project to
project, hyperlinks etc.

Im not sure if its at all possible through any means....im just
wanting to create some kind of Interface over the normal MS Project
view. If anyone knows anything at all about this I would be very
grateful if you could help me.

Thanks very much :)
 
K

Kiro

My main purpose of the Interface is so people can use the Projects iv
interlinked more easily....by using macro buttons to navigate round, rather
than use MS Projects menu systems.

I was also hoping to be able to add coloured background some how....as I
know you can't easily or I don't know how with MS Project.

Basically I want to make my custom "Interface" by someone helping me write
the code (if that way is possible) for what im asking or point me in the
right direction of software I can link to MS Project to get my desired effect
??

My time constraints for this is in weeks :|

Hope that gives you the details required to assist me...thank you for your
time im very grateful :)
 
E

Earl Lewis

Kiro,

I'm afraid several weeks isn't really enough time to scratch the surface of creating an entire user interface for a project portfolio application - unless your requirements are very very very very basic.

One thing I suppose you could do is automatically or manually generate some static HTML for each of your views and give folks a way to navigate from one to the other. Colored backgrounds are clearly do-able with HTML - although I'm not sure why that is such an important requirement. Why don't you look into creating some HTML pages and see how they work for you. If they look OK and you have a little HTML skill you could go that route.

The automation of generating the HTML pages is fairly straightforward. Something like this:

Sub Save2HTML(Optional strNewHTMLFilename As String = "NewHTMLFile.html")
' this procedure takes one optional string argument for the new HTML filename
' if the argument is left blank the new filename will be "NewHTMLFile.html"
'
' most of the MapEdit stuff just creates a mapping for the data export so you
' know which fields are going to be called what in the HTML output
'
' the first MapEdit line creates the export map, gives it a name of "Map 1"
' and tells the map what to export when the HTML is created.
'
' YOU SHOULD ADD ERROR TRAPPING TO THIS CODE
' ERROR TRAPPING EXCLUDED TO ENHANCE READABILITY

MapEdit Name:="Map 1", Create:=True, OverwriteExisting:=True, DataCategory:=0, CategoryEnabled:=True, TableName:="Entry", FieldName:="ID", ExternalFieldName:="ID", ExportFilter:="All Tasks", ImportMethod:=0, HeaderRow:=True, AssignmentData:=False, TextDelimiter:=Chr$(9), TextFileOrigin:=0, UseHtmlTemplate:=False, IncludeImage:=False
MapEdit Name:="Map 1", DataCategory:=0, FieldName:="Name", ExternalFieldName:="Task Name"
MapEdit Name:="Map 1", DataCategory:=0, FieldName:="Duration", ExternalFieldName:="Duration"
MapEdit Name:="Map 1", DataCategory:=0, FieldName:="Start", ExternalFieldName:="Start"
MapEdit Name:="Map 1", DataCategory:=0, FieldName:="Finish", ExternalFieldName:="Finish"
MapEdit Name:="Map 1", DataCategory:=0, FieldName:="% Complete", ExternalFieldName:="% Complete"
MapEdit Name:="Map 1", DataCategory:=0, FieldName:="Cost", ExternalFieldName:="Cost"
MapEdit Name:="Map 1", DataCategory:=0, FieldName:="Work", ExternalFieldName:="Work"
Application.FileSaveAs Name:=strNewHTMLFilename, FormatID:="MSProject.HTML", map:="Map 1"
End Sub

Sub SaveHTML()
Call Save2HTML
End Sub


Copy and paste this code into a module in project and you can run SaveHTML from the macros list - AltF8. Save2HTML won't appear in the macros list because it takes an argument and there's no way to pass the argument from that screen. When you're ready to take the next steps you'd need to pass in the filenames you want at runtime - which can be done with SaveHTML by simply slapping a filename string on the end of that call - like this:

Sub SaveHTML()
Call Save2HTML "MyReallyCoolProject.html"
End Sub

Hope that helps.

Earl
My main purpose of the Interface is so people can use the Projects iv
interlinked more easily....by using macro buttons to navigate round, rather
than use MS Projects menu systems.

I was also hoping to be able to add coloured background some how....as I
know you can't easily or I don't know how with MS Project.

Basically I want to make my custom "Interface" by someone helping me write
the code (if that way is possible) for what im asking or point me in the
right direction of software I can link to MS Project to get my desired effect
??

My time constraints for this is in weeks :|

Hope that gives you the details required to assist me...thank you for your
time im very grateful :)
 
K

Kiro

Earl,

Your the best :) .. .. This looks exactly like what im after (as im skilled
in HTML) - - The Interface doesn't have to be the best, just look half decent
and navigate round my projects in the resource pool.

You say add the code to a "module" .. .. Do I accomplish this by going into
"Tools", "Macro's" and then "Visual Basic Editor" and paste and save code in
there??

Once this is done can I run it from Macro list and start designing the HTML
page that represents the project?

Im new to this, so trying to get a handle on how it functions :)

Thank you so much for your input, its invaluable.
 
E

Earl Lewis

Kiro,

Your welcome for the help. That's why these groups are here. I've gotten help on these groups when I needed it so I try to contribute back when I can.

And you're right about the module, you can get there a little quicker by pressing Alt+F11. This takes you to the Visual Basic Editor, or VBE. Right click your Global.mpt project (ProjectGlobal) and then select Insert>Module.

Once you paste the code into the module save it, compile it (Debug > Compile) then you can switch back over to project pro with Alt+F11 again and run it with Alt+F8. Good luck and happy coding!

Earl
Earl,

Your the best :) .. .. This looks exactly like what im after (as im skilled
in HTML) - - The Interface doesn't have to be the best, just look half decent
and navigate round my projects in the resource pool.

You say add the code to a "module" .. .. Do I accomplish this by going into
"Tools", "Macro's" and then "Visual Basic Editor" and paste and save code in
there??

Once this is done can I run it from Macro list and start designing the HTML
page that represents the project?

Im new to this, so trying to get a handle on how it functions :)

Thank you so much for your input, its invaluable.
 
K

Kiro

Earl,

Here I am again, this is so new to me, I have no idea to be honest...sorry
if my questions are simple to answer, but im very grateful for your time
helping me.

I have entered the code below (in a new project file to test?) and both
files appear in the macro's list, but do nothing when "run"....im not sure
what to do next to build my interface or how this code links to web pages I
can make for each of my projects
-----------------------------------------------------------------------------------------------------------------------------
Sub Save2HTML(Optional strNewHTMLFilename As String = "NewHTMLFile.html")

MapEdit Name:="Map 1", Create:=True, OverwriteExisting:=True,
DataCategory:=0, CategoryEnabled:=True, TableName:="Entry", FieldName:="ID",
ExternalFieldName:="ID", ExportFilter:="All Tasks", ImportMethod:=0,
HeaderRow:=True, AssignmentData:=False, TextDelimiter:=Chr$(9),
TextFileOrigin:=0, UseHtmlTemplate:=False, IncludeImage:=False
MapEdit Name:="Map 1", DataCategory:=0, FieldName:="Name",
ExternalFieldName:="Task Name"
MapEdit Name:="Map 1", DataCategory:=0, FieldName:="Duration",
ExternalFieldName:="Duration"
MapEdit Name:="Map 1", DataCategory:=0, FieldName:="Start",
ExternalFieldName:="Start"
MapEdit Name:="Map 1", DataCategory:=0, FieldName:="Finish",
ExternalFieldName:="Finish"
MapEdit Name:="Map 1", DataCategory:=0, FieldName:="% Complete",
ExternalFieldName:="% Complete"
MapEdit Name:="Map 1", DataCategory:=0, FieldName:="Cost",
ExternalFieldName:="Cost"
MapEdit Name:="Map 1", DataCategory:=0, FieldName:="Work",
ExternalFieldName:="Work"
Application.FileSaveAs Name:=strNewHTMLFilename,
FormatID:="MSProject.HTML", map:="Map 1"
End Sub

Sub SaveHTML()
Call Save2HTML
End Sub

Sub Save1HTML()
Call Save2HTML("MyReallyCoolProject.html")
End Su
-----------------------------------------------------------------------------------------------------------------------------
The bottom argument iv had to put in brackets to compile due to syntax
error, not sure if that is ok.

Hope you can help me further, im quite lost on how it all goes together at
present and when I can build webpage(s) and how my information links from
project(s) files into my webpage(s).

Thanks very much for your continued help,

Kiro
 
E

Earl Lewis

Kiro,

Open one of your project plans before you run the macro. Then after the macro runs look on your default documents directory and see if it created a file.

If you run SaveHTML the file will be named NewHTMLFile.html and if you run your new routine called SaveHTML1 you should see a file called MyReallyCoolProject.html. Any help?

Earl
Earl,

Here I am again, this is so new to me, I have no idea to be honest...sorry
if my questions are simple to answer, but im very grateful for your time
helping me.

I have entered the code below (in a new project file to test?) and both
files appear in the macro's list, but do nothing when "run"....im not sure
what to do next to build my interface or how this code links to web pages I
can make for each of my projects?-----------------------------------------------------------------------------------------------------------------------------
Sub Save2HTML(Optional strNewHTMLFilename As String = "NewHTMLFile.html")

MapEdit Name:="Map 1", Create:=True, OverwriteExisting:=True,
DataCategory:=0, CategoryEnabled:=True, TableName:="Entry", FieldName:="ID",
ExternalFieldName:="ID", ExportFilter:="All Tasks", ImportMethod:=0,
HeaderRow:=True, AssignmentData:=False, TextDelimiter:=Chr$(9),
TextFileOrigin:=0, UseHtmlTemplate:=False, IncludeImage:=False
MapEdit Name:="Map 1", DataCategory:=0, FieldName:="Name",
ExternalFieldName:="Task Name"
MapEdit Name:="Map 1", DataCategory:=0, FieldName:="Duration",
ExternalFieldName:="Duration"
MapEdit Name:="Map 1", DataCategory:=0, FieldName:="Start",
ExternalFieldName:="Start"
MapEdit Name:="Map 1", DataCategory:=0, FieldName:="Finish",
ExternalFieldName:="Finish"
MapEdit Name:="Map 1", DataCategory:=0, FieldName:="% Complete",
ExternalFieldName:="% Complete"
MapEdit Name:="Map 1", DataCategory:=0, FieldName:="Cost",
ExternalFieldName:="Cost"
MapEdit Name:="Map 1", DataCategory:=0, FieldName:="Work",
ExternalFieldName:="Work"
Application.FileSaveAs Name:=strNewHTMLFilename,
FormatID:="MSProject.HTML", map:="Map 1"
End Sub

Sub SaveHTML()
Call Save2HTML
End Sub

Sub Save1HTML()
Call Save2HTML("MyReallyCoolProject.html")
End Sub-----------------------------------------------------------------------------------------------------------------------------
The bottom argument iv had to put in brackets to compile due to syntax
error, not sure if that is ok.

Hope you can help me further, im quite lost on how it all goes together at
present and when I can build webpage(s) and how my information links from
project(s) files into my webpage(s).

Thanks very much for your continued help,

Kiro
 
K

Kiro

Earl,

Sorry it has been a few days, had no time to even sit at computer....I have
gone through what you suggested and I now see both .html files once I run the
macro(s). First Question is, they both look the same so is there any
difference between what macro I choose to run and the resulting html file?

I assume which ever one of my projects I run the macro on it will display
that projects information in the html file?

Last question is how can I customise the html view so when the macro is run
it gets sent as it does now but into the html file I customise...

Thanks again Earl for your time.

Kiro
 
E

Earl Lewis

Kiro,

Replies inline below.

Earl
Sorry it has been a few days, had no time to even sit at computer....I have
gone through what you suggested and I now see both .html files once I run the
macro(s).
First Question is, they both look the same so is there any
difference between what macro I choose to run and the resulting html file?

The html file created will always be for the project you've got active on your desktop when the macro runs.
I assume which ever one of my projects I run the macro on it will display
that projects information in the html file?

Correct, see above.
Last question is how can I customise the html view so when the macro is run
it gets sent as it does now but into the html file I customise...

When you save as html there is an option to choose a template to use for the formatting etc... What you need to do is find out about the html template customization and then specify the template in the code so it gets used whenever you run it.

To find out about the template customization go the Help and search for "html template". You should also walk through the Save As Web Page... option manually so you can see where and how this all works.
 
K

Kiro

Earl,

That is just what im after, I have had a good look through all that, I have
also found a specific template im wanting to use....How do I go about telling
the macro to use a specific template (I have done it manually, but it needs
writing into the code I assume?)

My coding ability is zero, was hoping you could show me, if you have the
time of course.

The last thing is if we can get that working is, to keep the macro in the
"macro's list" and the template called in the code, does all the relevant
files need keeping in a common folder....because I will want to use this
system once built on other computers....but I assume the macro wouldn't be
there? and the template would be stored in a different directory path to one
specified in code maybe?

Thanks Earl, if the above can be done im buying you a pint or ten :)

Kiro
 
E

Earl Lewis

Kiro,

To learn how to code you can record macros of actions you want to perform then read through the code to see what Project actions get coded and how they get coded. You also need to recognize some basic stuff like the difference between a function (they return a value) and a procedure (called a sub - performs some actions but does not return a value). You also need to get familiar with variables and constants. Variables are predefined references to a value that can change and constants are references to a value that doesn't change - it's constant.

As far as referencing the template in the code goes, refer back to the original code (while your in the VB editor- press Alt+F11 from project pro) and find the line that looks like this:

MapEdit Name:="Map 1", Create:=True, OverwriteExisting:=True, DataCategory:=0, CategoryEnabled:=True, TableName:="Entry", FieldName:="ID", ExternalFieldName:="ID", ExportFilter:="All Tasks", ImportMethod:=0, HeaderRow:=True, AssignmentData:=False, TextDelimiter:=Chr$(9), TextFileOrigin:=0, UseHtmlTemplate:=False, IncludeImage:=False

Change the line so it includes something like the following, taking special note of the UseHTMLTemplate and TemplateFile arguments.

MapEdit Name:="Map 1", Create:=True, OverwriteExisting:=True, DataCategory:=0, CategoryEnabled:=True, TableName:="Entry", FieldName:="ID", ExternalFieldName:="ID", ExportFilter:="All Tasks", ImportMethod:=0, HeaderRow:=True, AssignmentData:=False, TextDelimiter:=Chr$(9), TextFileOrigin:=0, UseHtmlTemplate:=True, TemplateFile:="C:\Program Files\Microsoft Office\Project2003\Templates\1033\Microsoft Project Web\Centered Glacier.html", IncludeImage:=False

Just make sure that the template file exists in the location specified and you should be good to go. This should ensure that the template you want to use is applied to the HTML output everytime the code is run.

Something else you can use to learn more about coding is to go to the end of any existing code line, liket the one above, and type in a comma and press space. You'll see a list of arguments that can be used with the particular command or action for that line. Try it out. You can't hurt anything. Just remember to do a Debug>Compile before you run your code to make sure you don't have any blatant mistakes in your code.

Compiling isn't foolproof though. It basically just does a syntax check. You can still have plenty of other problems that will only arise at runtime, usually because you're trying to do something that's not allowed or not available at the particular moment the code runs.

To learn about the file location look into the help files for info on global.mpt. This is basically your personal global template on your workstation. You can put a file that has just this code in it on a network share and users can open that file to access the code when they need to run your procedures.

Exactly where will we be having that pint (or 10) anyway? Good luck and happy coding!

Earl

Earl,

That is just what im after, I have had a good look through all that, I have
also found a specific template im wanting to use....How do I go about telling
the macro to use a specific template (I have done it manually, but it needs
writing into the code I assume?)

My coding ability is zero, was hoping you could show me, if you have the
time of course.

The last thing is if we can get that working is, to keep the macro in the
"macro's list" and the template called in the code, does all the relevant
files need keeping in a common folder....because I will want to use this
system once built on other computers....but I assume the macro wouldn't be
there? and the template would be stored in a different directory path to one
specified in code maybe?

Thanks Earl, if the above can be done im buying you a pint or ten :)

Kiro
 
K

Kiro

Earl,

That works good as ever, The output file (once the macro is run) - by
default gets put in "My Documents" - Is there a way to specify in the code to
tell Project to place the 'output html' in a directory specified by me?

Once the above is sorted (if it can be of course) - that means I have all my
projects, template html and then the output in one directory - I will then
burn to CD to be able to run on another machine - but thinking ahead the
macro to make all this run won't be on the computer I get on, thinking about
the global.mpt....

I have looked into the help files, but it talks of network shares but im
trying to transfer all my work to run on a totally seperate machine....Not
sure if you know anything about that part Earl.

Those I think are the last two questions I need to ask....Hope you can help
again :)
By the way that drink (or ten) - name your place, if its close your on :)
 
E

Earl Lewis

Kiro,

See reply inline.

Earl
The output file (once the macro is run) - by
default gets put in "My Documents" - Is there a way to specify in the code to
tell Project to place the 'output html' in a directory specified by me?

This can get a little tricky. You can do it a number of ways and the best way depends on how easy you want to make it for the user. And believe me, if something you create doesn't work as well as the original software you're gonna hear about it.

The easiest way (for you) is to popup an inputbox where the user can type the full path to the directory. This is obviously prone to errors if the user types in a path that doesn't actually exist and it's definitely not easiest for the users.

The best way (for everyone) is to popup a form that works similarly to what the user already knows - a Windoze dialog box that lets them point to the directory - ergo, no typing errors.

Send me your email address and I'll send you a couple files that have the form and accompanying code that shows how I've accomplished this in the past. Posting the files on the list is a no-no.

When you get the files you'll need to import them into your global.mpt by right clicking the ProjectGlobal code project and selecting Import File...

I will then burn to CD to be able to run on another machine - but thinking ahead the
macro to make all this run won't be on the computer I get on, thinking about
the global.mpt....

Once you get it on a CD you can just copy it from the CD to the other machine. You need to make sure the users doesn't have anything already saved in the global.mpt before you overwrite theirs. Or create this as a new file and you can use the organizer in project to move the code to the users global,mpt.
 
K

Kiro

Earl,

My Email address: (e-mail address removed)

Once I import the files you send....whats the next step, this iv never done
before?
 

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