LabWindows/CVI

WordRpt_SetHeader

HRESULT WordRpt_SetHeader (CAObjHandle documentHandle, char *lefthandText, char *centerText, char *righthandText, WREnum_FieldType leftType, WREnum_FieldType centerType, WREnum_FieldType rightType);

Purpose

Sets up the header information for the specified report.

Note  If you used the WordRpt_AddPageNumbers function before this, take care not to write over the page number in this function.

Parameters

Input
Name Type Description
documentHandle CAObjHandle A handle to the Word Document object.

When it is no longer needed, this handle must be discarded using CA_DiscardObjHandle.
lefthandText char * The text to be displayed on the left side of the header. If no text is to be displayed, leave this field as "".
centerText char * The text to be displayed in the center of the header. If no text is to be displayed, leave this field as "".
righthandText char * The text to be displayed on the right side of the header. If no text is to be displayed, leave this field as "".
leftType WREnum_FieldType Specifies the kind of field to be displayed on the left side of the header. The default is WRConst_FieldEmpty.

Can be one of the following constants:

WRConst_FieldEmpty = –1
WRConst_FieldRef = 3
WRConst_FieldIndexEntry = 4
WRConst_FieldFootnoteRef = 5
WRConst_FieldSet = 6
WRConst_FieldIf = 7
WRConst_FieldIndex = 8
WRConst_FieldTOCEntry = 9
WRConst_FieldStyleRef = 10
WRConst_FieldRefDoc = 11
WRConst_FieldSequence = 12
WRConst_FieldTOC = 13
WRConst_FieldInfo = 14
WRConst_FieldTitle = 15
WRConst_FieldSubject = 16
WRConst_FieldAuthor = 17
WRConst_FieldKeyWord = 18
WRConst_FieldComments = 19
WRConst_FieldLastSavedBy = 20
WRConst_FieldCreateDate = 21
WRConst_FieldSaveDate = 22
WRConst_FieldPrintDate = 23
WRConst_FieldRevisionNum = 24
WRConst_FieldEditTime = 25
WRConst_FieldNumPages = 26
WRConst_FieldNumWords = 27
WRConst_FieldNumChars = 28
WRConst_FieldFileName = 29
WRConst_FieldTemplate = 30
WRConst_FieldDate = 31
WRConst_FieldTime = 32
WRConst_FieldPage = 33
WRConst_FieldExpression = 34
WRConst_FieldQuote = 35
WRConst_FieldInclude = 36
WRConst_FieldPageRef = 37
WRConst_FieldAsk = 38
WRConst_FieldFillIn = 39
WRConst_FieldData = 40
WRConst_FieldNext = 41
WRConst_FieldNextIf = 42
WRConst_FieldSkipIf = 43
WRConst_FieldMergeRec = 44
WRConst_FieldDDE = 45
WRConst_FieldDDEAuto = 46
WRConst_FieldGlossary = 47
WRConst_FieldPrint = 48
WRConst_FieldFormula = 49
WRConst_FieldGoToButton = 50
WRConst_FieldMacroButton = 51
WRConst_FieldAutoNumOutline = 52
WRConst_FieldAutoNumLegal = 53
WRConst_FieldAutoNum = 54
WRConst_FieldImport = 55
WRConst_FieldLink = 56
WRConst_FieldSymbol = 57
WRConst_FieldEmbed = 58
WRConst_FieldMergeField = 59
WRConst_FieldUserName = 60
WRConst_FieldUserInitials = 61
WRConst_FieldUserAddress = 62
WRConst_FieldBarCode = 63
WRConst_FieldDocVariable = 64
WRConst_FieldSection = 65
WRConst_FieldSectionPages = 66
WRConst_FieldIncludePicture = 67
WRConst_FieldIncludeText = 68
WRConst_FieldFileSize = 69
WRConst_FieldFormTextInput = 70
WRConst_FieldFormCheckBox = 71
WRConst_FieldNoteRef = 72
WRConst_FieldTOA = 73
WRConst_FieldTOAEntry = 74
WRConst_FieldMergeSeq = 75
WRConst_FieldPrivate = 77
WRConst_FieldDatabase = 78
WRConst_FieldAutoText = 79
WRConst_FieldCompare = 80
WRConst_FieldAddin = 81
WRConst_FieldSubscriber = 82
WRConst_FieldFormDropDown = 83
WRConst_FieldAdvance = 84
WRConst_FieldDocProperty = 85
WRConst_FieldOCX = 87
WRConst_FieldHyperlink = 88
WRConst_FieldAutoTextList = 89
WRConst_FieldListNum = 90
WRConst_FieldHTMLActiveX = 91
centerType WREnum_FieldType The kind of field to be displayed in the center of the header. The default is WRConst_FieldEmpty.

Can be one of the following constants:

WRConst_FieldEmpty = –1
WRConst_FieldRef = 3
WRConst_FieldIndexEntry = 4
WRConst_FieldFootnoteRef = 5
WRConst_FieldSet = 6
WRConst_FieldIf = 7
WRConst_FieldIndex = 8
WRConst_FieldTOCEntry = 9
WRConst_FieldStyleRef = 10
WRConst_FieldRefDoc = 11
WRConst_FieldSequence = 12
WRConst_FieldTOC = 13
WRConst_FieldInfo = 14
WRConst_FieldTitle = 15
WRConst_FieldSubject = 16
WRConst_FieldAuthor = 17
WRConst_FieldKeyWord = 18
WRConst_FieldComments = 19
WRConst_FieldLastSavedBy = 20
WRConst_FieldCreateDate = 21
WRConst_FieldSaveDate = 22
WRConst_FieldPrintDate = 23
WRConst_FieldRevisionNum = 24
WRConst_FieldEditTime = 25
WRConst_FieldNumPages = 26
WRConst_FieldNumWords = 27
WRConst_FieldNumChars = 28
WRConst_FieldFileName = 29
WRConst_FieldTemplate = 30
WRConst_FieldDate = 31
WRConst_FieldTime = 32
WRConst_FieldPage = 33
WRConst_FieldExpression = 34
WRConst_FieldQuote = 35
WRConst_FieldInclude = 36
WRConst_FieldPageRef = 37
WRConst_FieldAsk = 38
WRConst_FieldFillIn = 39
WRConst_FieldData = 40
WRConst_FieldNext = 41
WRConst_FieldNextIf = 42
WRConst_FieldSkipIf = 43
WRConst_FieldMergeRec = 44
WRConst_FieldDDE = 45
WRConst_FieldDDEAuto = 46
WRConst_FieldGlossary = 47
WRConst_FieldPrint = 48
WRConst_FieldFormula = 49
WRConst_FieldGoToButton = 50
WRConst_FieldMacroButton = 51
WRConst_FieldAutoNumOutline = 52
WRConst_FieldAutoNumLegal = 53
WRConst_FieldAutoNum = 54
WRConst_FieldImport = 55
WRConst_FieldLink = 56
WRConst_FieldSymbol = 57
WRConst_FieldEmbed = 58
WRConst_FieldMergeField = 59
WRConst_FieldUserName = 60
WRConst_FieldUserInitials = 61
WRConst_FieldUserAddress = 62
WRConst_FieldBarCode = 63
WRConst_FieldDocVariable = 64
WRConst_FieldSection = 65
WRConst_FieldSectionPages = 66
WRConst_FieldIncludePicture = 67
WRConst_FieldIncludeText = 68
WRConst_FieldFileSize = 69
WRConst_FieldFormTextInput = 70
WRConst_FieldFormCheckBox = 71
WRConst_FieldNoteRef = 72
WRConst_FieldTOA = 73
WRConst_FieldTOAEntry = 74
WRConst_FieldMergeSeq = 75
WRConst_FieldPrivate = 77
WRConst_FieldDatabase = 78
WRConst_FieldAutoText = 79
WRConst_FieldCompare = 80
WRConst_FieldAddin = 81
WRConst_FieldSubscriber = 82
WRConst_FieldFormDropDown = 83
WRConst_FieldAdvance = 84
WRConst_FieldDocProperty = 85
WRConst_FieldOCX = 87
WRConst_FieldHyperlink = 88
WRConst_FieldAutoTextList = 89
WRConst_FieldListNum = 90
WRConst_FieldHTMLActiveX = 91
rightType WREnum_FieldType The kind of field to be displayed on the right side of the header. The default is WRConst_FieldEmpty.

Can be one of the following constants:

WRConst_FieldEmpty = –1
WRConst_FieldRef = 3
WRConst_FieldIndexEntry = 4
WRConst_FieldFootnoteRef = 5
WRConst_FieldSet = 6
WRConst_FieldIf = 7
WRConst_FieldIndex = 8
WRConst_FieldTOCEntry = 9
WRConst_FieldStyleRef = 10
WRConst_FieldRefDoc = 11
WRConst_FieldSequence = 12
WRConst_FieldTOC = 13
WRConst_FieldInfo = 14
WRConst_FieldTitle = 15
WRConst_FieldSubject = 16
WRConst_FieldAuthor = 17
WRConst_FieldKeyWord = 18
WRConst_FieldComments = 19
WRConst_FieldLastSavedBy = 20
WRConst_FieldCreateDate = 21
WRConst_FieldSaveDate = 22
WRConst_FieldPrintDate = 23
WRConst_FieldRevisionNum = 24
WRConst_FieldEditTime = 25
WRConst_FieldNumPages = 26
WRConst_FieldNumWords = 27
WRConst_FieldNumChars = 28
WRConst_FieldFileName = 29
WRConst_FieldTemplate = 30
WRConst_FieldDate = 31
WRConst_FieldTime = 32
WRConst_FieldPage = 33
WRConst_FieldExpression = 34
WRConst_FieldQuote = 35
WRConst_FieldInclude = 36
WRConst_FieldPageRef = 37
WRConst_FieldAsk = 38
WRConst_FieldFillIn = 39
WRConst_FieldData = 40
WRConst_FieldNext = 41
WRConst_FieldNextIf = 42
WRConst_FieldSkipIf = 43
WRConst_FieldMergeRec = 44
WRConst_FieldDDE = 45
WRConst_FieldDDEAuto = 46
WRConst_FieldGlossary = 47
WRConst_FieldPrint = 48
WRConst_FieldFormula = 49
WRConst_FieldGoToButton = 50
WRConst_FieldMacroButton = 51
WRConst_FieldAutoNumOutline = 52
WRConst_FieldAutoNumLegal = 53
WRConst_FieldAutoNum = 54
WRConst_FieldImport = 55
WRConst_FieldLink = 56
WRConst_FieldSymbol = 57
WRConst_FieldEmbed = 58
WRConst_FieldMergeField = 59
WRConst_FieldUserName = 60
WRConst_FieldUserInitials = 61
WRConst_FieldUserAddress = 62
WRConst_FieldBarCode = 63
WRConst_FieldDocVariable = 64
WRConst_FieldSection = 65
WRConst_FieldSectionPages = 66
WRConst_FieldIncludePicture = 67
WRConst_FieldIncludeText = 68
WRConst_FieldFileSize = 69
WRConst_FieldFormTextInput = 70
WRConst_FieldFormCheckBox = 71
WRConst_FieldNoteRef = 72
WRConst_FieldTOA = 73
WRConst_FieldTOAEntry = 74
WRConst_FieldMergeSeq = 75
WRConst_FieldPrivate = 77
WRConst_FieldDatabase = 78
WRConst_FieldAutoText = 79
WRConst_FieldCompare = 80
WRConst_FieldAddin = 81
WRConst_FieldSubscriber = 82
WRConst_FieldFormDropDown = 83
WRConst_FieldAdvance = 84
WRConst_FieldDocProperty = 85
WRConst_FieldOCX = 87
WRConst_FieldHyperlink = 88
WRConst_FieldAutoTextList = 89
WRConst_FieldListNum = 90
WRConst_FieldHTMLActiveX = 91

Return Value

Name Type Description
status HRESULT A value indicating whether an error occurred. Function failure is indicated by a negative error code.

Error codes are defined in CVIversion\include\cviauto.h and <Program Files>\National Instruments\Shared\MSDTRedistributables\SDKHeaderFiles\8.1\winerror.h.

You can use CA_GetAutomationErrorString to get the description of an error code.

Additional Information

Library: Word Report

Include file: activex\word\WordReport.h

LabWindows/CVI compatibility: LabWindows/CVI 7.0 and later