Exporting to HTML

T

Tyler

I would like to automatically export project data to HTML every time I close
the file. Is this possible? Macro???

Thanks,
Tyler
 
M

Mike Glen

Hi Tyler,

Welcome to this Microsoft Project newsgroup :)

You could try recording a macro via Tools/Macro.../Record New Macro.../ give
it a name/OK and then run through the key/mouse strokes you want to employ.
Detailled instructions are given in my series on Microsoft Project in the
TechTrax ezine, particularly #16 - Macros, at this site:
http://tinyurl.com/2xbhc or this:
http://pubs.logicalexpressions.com/Pub0009/LPMFrame.asp?CMD=ArticleSearch&AUTH=23
(Perhaps you'd care to rate the article before leaving the site, :)
Thanks.)

FAQs, companion products and other useful Project information can be seen at
this web address: <http://www.mvps.org/project/>

Hope this helps - please let us know how you get on :)

Mike Glen
MS Project MVP
 
T

Tyler

Thanks Mike! That helped me get started. I'm looking for a little more help
though.

I have the following Macro code that Saves the file I am working on as HTML.
The problem is that I would like to use the same Macro for all files. Hard
coding the file name doesn't work. I need a way to grab the active project
name and plug it in to the save as line automatically. Is there a way to do
this? I'm working in Project 2003.

Sub Save_to_HTML()
' Macro Save_to_HTML
' Macro Recorded Tue 4/26/05 by

MapEdit Name:="Map 1", Create:=True, OverwriteExisting:=True,
DataCategory:=0, CategoryEnabled:=True, TableName:="Tasks", FieldName:="ID",
ExternalFieldName:="ID", ExportFilter:="All Tasks", ImportMethod:=0,
HeaderRow:=True, AssignmentData:=False, TextDelimiter:=Chr$(9),
TextFileOrigin:=0, UseHtmlTemplate:=True, TemplateFile:="\\path\Columns
Navy.html", 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:="Resource Names",
ExternalFieldName:="Resource Names"
MapEdit Name:="Map 1", DataCategory:=0, FieldName:="% Complete",
ExternalFieldName:="% Complete"
MapEdit Name:="Map 1", DataCategory:=1, CategoryEnabled:=True,
TableName:="Resources", FieldName:="ID", ExternalFieldName:="ID",
ExportFilter:="All Resources", ImportMethod:=0
MapEdit Name:="Map 1", DataCategory:=1, FieldName:="Name",
ExternalFieldName:="Name"
MapEdit Name:="Map 1", DataCategory:=1, FieldName:="Group",
ExternalFieldName:="Group"
MapEdit Name:="Map 1", DataCategory:=1, FieldName:="Max Units",
ExternalFieldName:="Max Units"
MapEdit Name:="Map 1", DataCategory:=1, FieldName:="Peak",
ExternalFieldName:="Peak Units"
MapEdit Name:="Map 1", DataCategory:=2, CategoryEnabled:=True,
TableName:="Assignments", FieldName:="Task ID", ExternalFieldName:="Task ID",
ImportMethod:=0
MapEdit Name:="Map 1", DataCategory:=2, FieldName:="Task Name",
ExternalFieldName:="Task Name"
MapEdit Name:="Map 1", DataCategory:=2, FieldName:="Resource Name",
ExternalFieldName:="Resource Name"
MapEdit Name:="Map 1", DataCategory:=2, FieldName:="Work",
ExternalFieldName:="Work"
MapEdit Name:="Map 1", DataCategory:=2, FieldName:="Start",
ExternalFieldName:="Start"
MapEdit Name:="Map 1", DataCategory:=2, FieldName:="Finish",
ExternalFieldName:="Finish"
MapEdit Name:="Map 1", DataCategory:=2, FieldName:="% Work Complete",
ExternalFieldName:="% Work Complete"
FileSaveAs Name:="\\path\(ActiveProject.Name)",
FormatID:="MSProject.HTML", map:="Map 1"

End Sub

__________________________________________________________________________
 
M

Mike Glen

You're welcome, Tyler. However, I'm not a code expert, and although I'm
certain it can be done, if someone else doesn't step in here, then you could
try posting on the server newsgroup. Please see FAQ Item: 24. Project
Newsgroups. FAQs, companion products and other useful Project information
can be seen at this web address: http://www.mvps.org/project/.

Mike Glen
Project MV
 
T

Tyler

Thanks JulieD,

I made the change and I am getting a compile error:
If no quote before \\path it errors there.
When I add the quote before the path, I get a compile error at
"MSProject.html"

I'm not sure what to do!

FileSaveAs Name:="\\path\" & ActiveProject.Name & ",
FormatID:="MSProject.html", map:="Map 2"
 
J

JulieD

Hi,
sorry try

FileSaveAs Name:="\\path\" & ActiveProject.Name,
FormatID:="MSProject.html", map:="Map 2"
 

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