Table of contents
TOC
Collapse the table of content
Expand the table of content

Application.MapEdit Method (Project)

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

Creates or edits an import/export map.

Syntax

expression. MapEdit( ** Name, ** Create, ** OverwriteExisting, ** NewName, ** DataCategory, ** CategoryEnabled, ** TableName, ** FieldName, ** ExternalFieldName, ** ExportFilter, ** ImportMethod, ** MergeKey, ** HeaderRow, ** AssignmentData, ** TextDelimiter, ** TextFileOrigin, ** UseHtmlTemplate, ** TemplateFile, ** IncludeImage, ** ImageFile )

expression A variable that represents an Application object.

Parameters

NameRequired/OptionalData TypeDescription
NameOptionalStringThe name of the map to create, copy, or edit.
CreateOptionalBooleanTrue if Project should create a new map. If NewName is not specified, the new map is given the name specified with Name. Otherwise, the new map is a copy of the map specified with Name and is given the name specified with NewName. The default value is False.
OverwriteExistingOptionalBooleanTrue if an existing map should be overwritten with a new one. The default value is False.
NewNameOptionalStringA new name for the existing map (Create is False ) or the name for the new map copied from the existing map (Create is True ). If NewName is not specified and Create is False, the map specified with Name retains its current name. The default value is an empty string ("").
DataCategoryOptionalLongThe category of data that will be modified by other arguments. Required if any of CategoryEnabled, TableName, FieldName, ExternalFieldName, ExportFilter, or MergeKey are specified. Can be one of the following PjDataCategories constants: pjMapTasks, pjMapResources, or pjMapAssignments.
CategoryEnabledOptionalBooleanTrue if the map imports and exports the category of data specified with DataCategory. If Create is True and NewName is not specified, CategoryEnabled is set to True.
TableNameOptionalStringThe name of the external table or worksheet that the map imports data from or exports data to. The type of table is determined by the value of DataCategory. If Create is True and NewName is not specified, TableName is required.
FieldNameOptionalStringThe name of a field to add to the map. The field is mapped to the external field specified with ExternalFieldName. The type of field is determined by the value of DataCategory. If Create is True and NewName is not specified, FieldName is required.
ExternalFieldNameOptionalStringThe name of the external field to add to the map. The external field is mapped to the field specified with FieldName. If ExternalFieldName is not specified, the name specified with FieldName is also used for ExternalFieldName.
ExportFilterOptionalStringThe name of the filter to use when exporting data. The type of filter is determined by the value of DataCategory. The default value is "All Tasks" when DataCategory is pjMapTasks, "All Resources" when DataCategory is pjMapResources, and ExportFilter is ignored when DataCategory is pjMapAssignments.
ImportMethodOptionalLongThe method to use when importing data. Can be one of the PjImportMethods constants. The default value is pjImportNew.
MergeKeyOptionalStringThe name of the project field to use as a key when merging imported data. The field must exist and have already been added to the map. The type of field is determined by the value of DataCategory. If ImportMethod is pjImportMerge, MergeKey is required.
HeaderRowOptionalBooleanTrue if a column header row should be created in the external file during an export and whether it exists in the external file during an import. If creating a headerless map (HeaderRow is False ) that will be used to import the same data it exports, ExternalFieldName is required and must be a sequentially numbered value for each field exported, beginning with "1", to indicate its column position in the exported file. The default value is True.
AssignmentDataOptionalBooleanTrue if assignment rows should be included with exported resources and tasks. If True, assigned resources appear under each task in a task table and assigned tasks appear under each resource in a resource table. Data exported when AssignmentData is True cannot be imported by Project. The default value is False.
TextDelimiterOptionalStringThe character to use as a field delimiter when importing data from a text file. The default value is a tab character.
TextFileOriginOptionalLongSpecifies the character set under which a text file was created. Can be one of the following PjTextFileOrigin constants: pjTextOriginWin, pjTextOriginDOS, pjTextOriginUnicode, or pjTextOriginMac.
UseHtmlTemplateOptionalBooleanTrue if an export to an HTML file will be based on an HTML template.
TemplateFileOptionalStringThe HTML template file to use when exporting to HTML. If UseHtmlTemplate is True and the map specified with Name does not contain the name of an HTML template file, TemplateFile is required.
IncludeImageOptionalBooleanTrue if a reference to an image file should be included when exporting to HTML. The default value is False.
ImageFileOptionalStringThe name of an image file to include when exporting to HTML.

Return Value

Boolean

Example

The following example creates a simple map that allows the information on the default Gantt Chart to be exported and imported.

Sub MakeEntryTableMap() 

 MapEdit Name:="Fields in the Gantt Chart View", Create:=True, OverwriteExisting:=True, _ 
 DataCategory:=pjMapTasks, CategoryEnabled:=True, TableName:="Task_Table", _ 
 FieldName:="ID", ExternalFieldName:="ID" 
 MapEdit Name:="Fields in the Gantt Chart View", DataCategory:=pjMapTasks, _ 
 FieldName:="Name", ExternalFieldName:="Tasks" 
 MapEdit Name:="Fields in the Gantt Chart View", DataCategory:=pjMapTasks, _ 
 FieldName:="Duration" 
 MapEdit Name:="Fields in the Gantt Chart View", DataCategory:=pjMapTasks, _ 
 FieldName:="Start", ExternalFieldName:="Start_Date" 
 MapEdit Name:="Fields in the Gantt Chart View", DataCategory:=pjMapTasks, _ 
 FieldName:="Finish", ExternalFieldName:="Finish_Date" 
 MapEdit Name:="Fields in the Gantt Chart View", DataCategory:=pjMapTasks, _ 
 FieldName:="Predecessors" 
 MapEdit Name:="Fields in the Gantt Chart View", DataCategory:=pjMapTasks, _ 
 FieldName:="Resource Names", ExternalFieldName:="Resources" 

End Sub
© 2017 Microsoft