Pasar datos de Access a Word
Tengo una tabla en Access cuyos datos quiero llevar a un documento de Word. En el documento de Word tengo unos códigos de campo BASEDEDATOS dentro de un cuadro de texto del encabezado, cuando desde Access voy a Herramientas - Vínculos con Office - Combinar con MS Word se abre el documento de Word con los campos actualizados, ¿sabes cómo puedo hacer esto desde Visual Basic en Access?. Con DDE consigo abrir el documento pero no se actualizan los campos si no los selecciono previamente y hay varios encabezados y pies distintos.
¡Perdona por el rollo!
¡Perdona por el rollo!
1 respuesta
Respuesta de sofocles
1
1
Prueba a utilizar la acción runcommand.
A continuación te envio la ayuda de Access para este metodo:
Método RunCommand
Vea también Se aplica a Ejemplo Específicos
El método RunCommand ejecuta un comando de menú integrado de barra de herramientas.
Expresión. RunCommand(Comando)
Expresión Requerida. Expresión que devuelve uno de los objetos de la lista Aplicar a.
Comando AcCommand requerido. Una constante intrínseca que especifica qué comando de menú o de barra de herramientas se va a ejecutar.
AcCommand puede ser una de estas constantes AcCommand.
AcCmdAboutMicrosoftAccess
AcCmdAddInManager
AcCmdAddToNewGroup
AcCmdAddWatch
AcCmdAdvancedFilterSort
AcCmdAlignBottom
AcCmdAlignCenter
AcCmdAlignLeft
AcCmdAlignmentAndSizing
AcCmdAlignMiddle
AcCmdAlignRight
AcCmdAlignToGrid
AcCmdAlignTop
AcCmdAlignToShortest
AcCmdAlignToTallest
AcCmdAnalyzePerformance
AcCmdAnalyzeTable
AcCmdAnswerWizard
AcCmdApplyDefault
AcCmdApplyFilterSort
AcCmdAppMaximize
AcCmdAppMinimize
AcCmdAppMove
AcCmdAppRestore
AcCmdAppSize
AcCmdArrangeIconsAuto
AcCmdArrangeIconsByCreated
AcCmdArrangeIconsByModified
AcCmdArrangeIconsByName
AcCmdArrangeIconsByType
AcCmdAutoCorrect
AcCmdAutoDial
AcCmdAutoFormat
AcCmdBackgroundPicture
AcCmdBackgroundSound
AcCmdBackup
AcCmdBookmarksClearAll
AcCmdBookmarksNext
AcCmdBookmarksPrevious
AcCmdBookmarksToggle
AcCmdBringToFront
AcCmdCallStack
AcCmdChangeToCheckBox
AcCmdChangeToComboBox
AcCmdChangeToCommandButton
AcCmdChangeToImage
AcCmdChangeToLabel
AcCmdChangeToListBox
AcCmdChangeToOptionButton
AcCmdChangeToTextBox
AcCmdChangeToToggleButton
AcCmdChartSortAscByTotal
AcCmdChartSortDescByTotal
AcCmdClearAll
AcCmdClearAllBreakPoints
AcCmdClearGrid
AcCmdClearHyperlink
AcCmdClearItemDefaults
AcCmdClose
AcCmdCloseWindow
AcCmdColumnWidth
AcCmdCompactDatabase
AcCmdCompileAllModules
AcCmdCompileAndSaveAllModules
AcCmdCompileLoadedModules
AcCmdCompleteWord
AcCmdConditionalFormatting
AcCmdConnection
AcCmdControlWizardsToggle
AcCmdConvertDatabase
AcCmdConvertMacrosToVisualBasic
AcCmdCopy
AcCmdCopyDatabaseFile
AcCmdCopyHyperlink
AcCmdCreateMenuFromMacro
AcCmdCreateRelationship
AcCmdCreateReplica
AcCmdCreateShortcut
AcCmdCreateShortcutMenuFromMacro
AcCmdCreateToolbarFromMacro
AcCmdCut
AcCmdDataAccessPageAddToPage
AcCmdDataAccessPageBrowse
AcCmdDataAccessPageDesignView
AcCmdDataAccessPageFieldListRefresh
AcCmdDatabaseProperties
AcCmdDatabaseSplitter
AcCmdDataEntry
AcCmdDataOutline
AcCmdDatasheetView
AcCmdDateAndTime
AcCmdDebugWindow
AcCmdDelete
AcCmdDeleteGroup
AcCmdDeletePage
AcCmdDeleteQueryColumn
AcCmdDeleteRecord
AcCmdDeleteRows
AcCmdDeleteTab
AcCmdDeleteTable
AcCmdDeleteTableColumn
AcCmdDeleteWatch
AcCmdDemote
AcCmdDesignView
AcCmdDiagramAddRelatedTables
AcCmdDiagramAutosizeSelectedTables
AcCmdDiagramDeleteRelationship
AcCmdDiagramLayoutDiagram
AcCmdDiagramLayoutSelection
AcCmdDiagramModifyUserDefinedView
AcCmdDiagramNewLabel
AcCmdDiagramNewTable
AcCmdDiagramRecalculatePageBreaks
AcCmdDiagramShowRelationshipLabels
AcCmdDiagramViewPageBreaks
AcCmdDocMaximize
AcCmdDocMinimize
AcCmdDocMove
AcCmdDocRestore
AcCmdDocSize
AcCmdDocumenter
AcCmdDropSQLDatabase
AcCmdDuplicate
AcCmdEditHyperlink
AcCmdEditingAllowed
AcCmdEditRelationship
AcCmdEditTriggers
AcCmdEditWatch
AcCmdEncryptDecryptDatabase
AcCmdEnd
AcCmdExit
AcCmdExport
AcCmdFavoritesAddTo
AcCmdFavoritesOpen
AcCmdFieldList
AcCmdFilterByForm
AcCmdFilterBySelection
AcCmdFilterExcludingSelection
AcCmdFind
AcCmdFindNext
AcCmdFindNextWordUnderCursor
AcCmdFindPrevious
AcCmdFindPrevWordUnderCursor
AcCmdFitToWindow
AcCmdFont
AcCmdFormatCells
AcCmdFormHdrFtr
AcCmdFormView
AcCmdFreezeColumn
AcCmdGoBack
AcCmdGoContinue
AcCmdGoForward
AcCmdGroupByTable
AcCmdGroupControls
AcCmdHideColumns
AcCmdHidePane
AcCmdHideTable
AcCmdHorizontalSpacingDecrease
AcCmdHorizontalSpacingIncrease
AcCmdHorizontalSpacingMakeEqual
AcCmdHyperlinkDisplayText
AcCmdImport
AcCmdIndent
AcCmdIndexes
AcCmdInsertActiveXControl
AcCmdInsertChart
AcCmdInsertFile
AcCmdInsertFileIntoModule
AcCmdInsertHyperlink
AcCmdInsertLookupColumn
AcCmdInsertLookupField
AcCmdInsertMovieFromFile
AcCmdInsertObject
AcCmdInsertPage
AcCmdInsertPicture
AcCmdInsertPivotTable
AcCmdInsertProcedure
AcCmdInsertQueryColumn
AcCmdInsertRows
AcCmdInsertSpreadsheet
AcCmdInsertSubdatasheet
AcCmdInsertTableColumn
AcCmdInsertUnboundSection
AcCmdInvokeBuilder
AcCmdJoinProperties
AcCmdLastPosition
AcCmdLayoutPreview
AcCmdLineUpIcons
AcCmdLinkedTableManager
AcCmdLinkTables
AcCmdListConstants
AcCmdLoadFromQuery
AcCmdMacroConditions
AcCmdMacroNames
AcCmdMakeMDEFile
AcCmdMaximiumRecords
AcCmdMicrosoftAccessHelpTopics
AcCmdMicrosoftOnTheWeb
AcCmdMicrosoftScriptEditor
AcCmdMoreWindows
AcCmdNewDatabase
AcCmdNewGroup
AcCmdNewObjectAutoForm
AcCmdNewObjectAutoReport
AcCmdNewObjectClassModule
AcCmdNewObjectDataAccessPage
AcCmdNewObjectDiagram
AcCmdNewObjectForm
AcCmdNewObjectFunction
AcCmdNewObjectMacro
AcCmdNewObjectModule
AcCmdNewObjectQuery
AcCmdNewObjectReport
AcCmdNewObjectStoredProcedure
AcCmdNewObjectTable
AcCmdNewObjectView
AcCmdObjBrwFindWholeWordOnly
AcCmdObjBrwGroupMembers
AcCmdObjBrwHelp
AcCmdObjBrwShowHiddenMembers
AcCmdObjBrwViewDefinition
AcCmdObjectBrowser
AcCmdOfficeClipboard
AcCmdOLEDDELinks
AcCmdOLEObjectConvert
AcCmdOLEObjectDefaultVerb
AcCmdOpenDatabase
AcCmdOpenHyperlink
AcCmdOpenNewHyperlink
AcCmdOpenSearchPage
AcCmdOpenStartPage
AcCmdOpenTable
AcCmdOpenURL
AcCmdOptions
AcCmdOutdent
AcCmdOutputToExcel
AcCmdOutputToRTF
AcCmdOutputToText
AcCmdPageHdrFtr
AcCmdPageNumber
AcCmdPageProperties
AcCmdPageSetup
AcCmdParameterInfo
AcCmdPartialReplicaWizard
AcCmdPaste
AcCmdPasteAppend
AcCmdPasteAsHyperlink
AcCmdPasteSpecial
AcCmdPivotAutoAverage
AcCmdPivotAutoCount
AcCmdPivotAutoFilter
AcCmdPivotAutoMax
AcCmdPivotAutoMin
AcCmdPivotAutoStdDev
AcCmdPivotAutoStdDevP
AcCmdPivotAutoSum
AcCmdPivotAutoVar
AcCmdPivotAutoVarP
AcCmdPivotChartByRowByColumn
AcCmdPivotChartDrillInto
AcCmdPivotChartDrillOut
AcCmdPivotChartMultiplePlots
AcCmdPivotChartMultiplePlotsUnifiedScale
acCmdPivotChartShowLegend
acCmdPivotChartType
acCmdPivotChartUndo
acCmdPivotChartView
acCmdPivotCollapse
acCmdPivotDelete
acCmdPivotDropAreas
acCmdPivotExpand
acCmdPivotRefresh
acCmdPivotShowAll
acCmdPivotShowBottom1
acCmdPivotShowBottom10
acCmdPivotShowBottom10Percent
acCmdPivotShowBottom1Percent
acCmdPivotShowBottom2
acCmdPivotShowBottom25
acCmdPivotShowBottom25Percent
acCmdPivotShowBottom2Percent
acCmdPivotShowBottom5
acCmdPivotShowBottom5Percent
acCmdPivotShowBottomOther
acCmdPivotShowTop1
acCmdPivotShowTop10
acCmdPivotShowTop10Percent
acCmdPivotShowTop1Percent
acCmdPivotShowTop2
acCmdPivotShowTop25
acCmdPivotShowTop25Percent
acCmdPivotShowTop2Percent
acCmdPivotShowTop5
acCmdPivotShowTop5Percent
acCmdPivotShowTopOther
acCmdPivotTableClearCustomOrdering
acCmdPivotTableCreateCalcField
acCmdPivotTableCreateCalcTotal
acCmdPivotTableDemote
acCmdPivotTableExpandIndicators
acCmdPivotTableExportToExcel
acCmdPivotTableFilterBySelection
acCmdPivotTableGroupItems
acCmdPivotTableHideDetails
acCmdPivotTableMoveToColumnArea
acCmdPivotTableMoveToDetailArea
acCmdPivotTableMoveToFilterArea
acCmdPivotTableMoveToRowArea
acCmdPivotTablePercentColumnTotal
acCmdPivotTablePercentGrandTotal
acCmdPivotTablePercentParentColumnItem
acCmdPivotTablePercentParentRowItem
acCmdPivotTablePercentRowTotal
acCmdPivotTablePromote
acCmdPivotTableRemove
acCmdPivotTableShowAsNormal
acCmdPivotTableShowDetails
acCmdPivotTableSubtotal
acCmdPivotTableUngroupItems
acCmdPivotTableView
acCmdPreviewEightPages
acCmdPreviewFourPages
acCmdPreviewOnePage
acCmdPreviewTwelvePages
acCmdPreviewTwoPages
acCmdPrimaryKey
acCmdPrint
acCmdPrintPreview
acCmdPrintRelationships
acCmdProcedureDefinition
acCmdPromote
acCmdProperties
acCmdPublish
acCmdPublishDefaults
acCmdQueryAddToOutput
acCmdQueryGroupBy
acCmdQueryParameters
acCmdQueryTotals
acCmdQueryTypeAppend
acCmdQueryTypeCrosstab
acCmdQueryTypeDelete
acCmdQueryTypeMakeTable
acCmdQueryTypeSelect
acCmdQueryTypeSQLDataDefinition
acCmdQueryTypeSQLPassThrough
acCmdQueryTypeSQLUnion
acCmdQueryTypeUpdate
acCmdQuickInfo
acCmdQuickPrint
acCmdQuickWatch
acCmdRecordsGoToFirst
acCmdRecordsGoToLast
acCmdRecordsGoToNew
acCmdRecordsGoToNext
acCmdRecordsGoToPrevious
acCmdRecoverDesignMaster
acCmdRedo
acCmdReferences
acCmdRefresh
acCmdRefreshPage
acCmdRegisterActiveXControls
acCmdRelationships
acCmdRemove
acCmdRemoveFilterSort
acCmdRemoveTable
acCmdRename
acCmdRenameColumn
acCmdRenameGroup
acCmdRepairDatabase
acCmdReplace
acCmdReportHdrFtr
acCmdReset
acCmdResolveConflicts
acCmdRestore
acCmdRowHeight
acCmdRun
acCmdRunMacro
acCmdRunOpenMacro
acCmdSave
acCmdSaveAllModules
acCmdSaveAllRecords
acCmdSaveAs
acCmdSaveAsASP
acCmdSaveAsDataAccessPage
acCmdSaveAsHTML
acCmdSaveAsIDC
acCmdSaveAsQuery
acCmdSaveAsReport
acCmdSaveLayout
acCmdSaveModuleAsText
acCmdSaveRecord
acCmdSelectAll
acCmdSelectAllRecords
acCmdSelectDataAccessPage
acCmdSelectForm
acCmdSelectRecord
acCmdSelectReport
acCmdSend
acCmdSendToBack
acCmdServerFilterByForm
acCmdServerProperties
acCmdSetControlDefaults
acCmdSetDatabasePassword
acCmdSetNextStatement
acCmdShowAllRelationships
acCmdShowDirectRelationships
acCmdShowEnvelope
acCmdShowMembers
acCmdShowNextStatement
acCmdShowOnlyWebToolbar
acCmdShowTable
acCmdSingleStep
acCmdSizeToFit
acCmdSizeToFitForm
acCmdSizeToGrid
acCmdSizeToNarrowest
acCmdSizeToWidest
acCmdSnapToGrid
acCmdSortAscending
acCmdSortDescending
acCmdSortingAndGrouping
acCmdSpeech
acCmdSpelling
acCmdSQLView
acCmdStartupProperties
acCmdStepInto
acCmdStepOut
acCmdStepOver
acCmdStepToCursor
acCmdStopLoadingPage
acCmdSubdatasheetCollapseAll
acCmdSubdatasheetExpandAll
acCmdSubdatasheetRemove
acCmdSubformDatasheet
acCmdSubformDatasheetView
acCmdSubformFormView
acCmdSubformInNewWindow
acCmdSubformPivotChartView
acCmdSubformPivotTableView
acCmdSwitchboardManager
acCmdSynchronizeNow
acCmdTabControlPageOrder
acCmdTableAddTable
acCmdTableCustomView
acCmdTableNames
acCmdTabOrder
acCmdTestValidationRules
acCmdTileHorizontally
acCmdTileVertically
acCmdToggleBreakPoint
acCmdToggleFilter
acCmdToolbarControlProperties
acCmdToolbarsCustomize
acCmdTransferSQLDatabase
acCmdTransparentBackground
acCmdTransparentBorder
acCmdUndo
acCmdUndoAllRecords
acCmdUnfreezeAllColumns
acCmdUngroupControls
acCmdUnhideColumns
acCmdUpsizingWizard
acCmdUserAndGroupAccounts
acCmdUserAndGroupPermissions
acCmdUserLevelSecurityWizard
acCmdVerticalSpacingDecrease
acCmdVerticalSpacingIncrease
acCmdVerticalSpacingMakeEqual
acCmdViewCode
acCmdViewDataAccessPages
acCmdViewDetails
acCmdViewDiagrams
acCmdViewFieldList
acCmdViewForms
acCmdViewFunctions
acCmdViewGrid
acCmdViewLargeIcons
acCmdViewList
acCmdViewMacros
acCmdViewModules
acCmdViewQueries
acCmdViewReports
acCmdViewRuler
acCmdViewShowPaneDiagram
acCmdViewShowPaneGrid
acCmdViewShowPaneSQL
acCmdViewSmallIcons
acCmdViewStoredProcedures
acCmdViewTableColumnNames
acCmdViewTableColumnProperties
acCmdViewTableKeys
acCmdViewTableNameOnly
acCmdViewTables
acCmdViewTableUserView
acCmdViewToolbox
acCmdViewVerifySQL
acCmdViewViews
acCmdVisualBasicEditor
acCmdWebPagePreview
acCmdWebPageProperties
acCmdWebTheme
acCmdWindowArrangeIcons
acCmdWindowCascade
acCmdWindowHide
acCmdWindowSplit
acCmdWindowUnhide
acCmdWordMailMerge
acCmdWorkgroupAdministrator
acCmdZoom10
acCmdZoom100
acCmdZoom1000
acCmdZoom150
acCmdZoom200
acCmdZoom25
acCmdZoom50
acCmdZoom500
acCmdZoom75
acCmdZoomBox
acCmdZoomSelection
Comentarios
Cada comando de menú y de barra de herramientas de Microsoft Access tiene una constante asociada que puede utilizar con el método RunCommand para ejecutar ese comando desde Visual Basic.
No puede usar el método RunCommand para ejecutar un comando en un menú o barra de herramientas personalizada. Sólo puede usarlo con menús y barras de herramientas integradas.
El método RunCommand reemplaza al método DoMenuItem del objeto DoCmd.
Ejemplo
El ejemplo siguiente utiliza el método RunCommand para abrir el cuadro de diálogo Opciones (menú Herramientas).
Public Function OpenOptionsDialog() As Boolean
On Error GoTo Error_OpenOptionsDialog
DoCmd.RunCommand acCmdOptions
OpenOptionsDialog = True
Exit_OpenOptionsDialog:
Exit Function
Error_OpenOptionsDialog:
MsgBox Err & ": " & Err.Description
OpenOptionsDialog = False
Resume Exit_OpenOptionsDialog
End Function
La opción para combinar con MS Word es:
AcCmdWordMailMerge
A continuación te envio la ayuda de Access para este metodo:
Método RunCommand
Vea también Se aplica a Ejemplo Específicos
El método RunCommand ejecuta un comando de menú integrado de barra de herramientas.
Expresión. RunCommand(Comando)
Expresión Requerida. Expresión que devuelve uno de los objetos de la lista Aplicar a.
Comando AcCommand requerido. Una constante intrínseca que especifica qué comando de menú o de barra de herramientas se va a ejecutar.
AcCommand puede ser una de estas constantes AcCommand.
AcCmdAboutMicrosoftAccess
AcCmdAddInManager
AcCmdAddToNewGroup
AcCmdAddWatch
AcCmdAdvancedFilterSort
AcCmdAlignBottom
AcCmdAlignCenter
AcCmdAlignLeft
AcCmdAlignmentAndSizing
AcCmdAlignMiddle
AcCmdAlignRight
AcCmdAlignToGrid
AcCmdAlignTop
AcCmdAlignToShortest
AcCmdAlignToTallest
AcCmdAnalyzePerformance
AcCmdAnalyzeTable
AcCmdAnswerWizard
AcCmdApplyDefault
AcCmdApplyFilterSort
AcCmdAppMaximize
AcCmdAppMinimize
AcCmdAppMove
AcCmdAppRestore
AcCmdAppSize
AcCmdArrangeIconsAuto
AcCmdArrangeIconsByCreated
AcCmdArrangeIconsByModified
AcCmdArrangeIconsByName
AcCmdArrangeIconsByType
AcCmdAutoCorrect
AcCmdAutoDial
AcCmdAutoFormat
AcCmdBackgroundPicture
AcCmdBackgroundSound
AcCmdBackup
AcCmdBookmarksClearAll
AcCmdBookmarksNext
AcCmdBookmarksPrevious
AcCmdBookmarksToggle
AcCmdBringToFront
AcCmdCallStack
AcCmdChangeToCheckBox
AcCmdChangeToComboBox
AcCmdChangeToCommandButton
AcCmdChangeToImage
AcCmdChangeToLabel
AcCmdChangeToListBox
AcCmdChangeToOptionButton
AcCmdChangeToTextBox
AcCmdChangeToToggleButton
AcCmdChartSortAscByTotal
AcCmdChartSortDescByTotal
AcCmdClearAll
AcCmdClearAllBreakPoints
AcCmdClearGrid
AcCmdClearHyperlink
AcCmdClearItemDefaults
AcCmdClose
AcCmdCloseWindow
AcCmdColumnWidth
AcCmdCompactDatabase
AcCmdCompileAllModules
AcCmdCompileAndSaveAllModules
AcCmdCompileLoadedModules
AcCmdCompleteWord
AcCmdConditionalFormatting
AcCmdConnection
AcCmdControlWizardsToggle
AcCmdConvertDatabase
AcCmdConvertMacrosToVisualBasic
AcCmdCopy
AcCmdCopyDatabaseFile
AcCmdCopyHyperlink
AcCmdCreateMenuFromMacro
AcCmdCreateRelationship
AcCmdCreateReplica
AcCmdCreateShortcut
AcCmdCreateShortcutMenuFromMacro
AcCmdCreateToolbarFromMacro
AcCmdCut
AcCmdDataAccessPageAddToPage
AcCmdDataAccessPageBrowse
AcCmdDataAccessPageDesignView
AcCmdDataAccessPageFieldListRefresh
AcCmdDatabaseProperties
AcCmdDatabaseSplitter
AcCmdDataEntry
AcCmdDataOutline
AcCmdDatasheetView
AcCmdDateAndTime
AcCmdDebugWindow
AcCmdDelete
AcCmdDeleteGroup
AcCmdDeletePage
AcCmdDeleteQueryColumn
AcCmdDeleteRecord
AcCmdDeleteRows
AcCmdDeleteTab
AcCmdDeleteTable
AcCmdDeleteTableColumn
AcCmdDeleteWatch
AcCmdDemote
AcCmdDesignView
AcCmdDiagramAddRelatedTables
AcCmdDiagramAutosizeSelectedTables
AcCmdDiagramDeleteRelationship
AcCmdDiagramLayoutDiagram
AcCmdDiagramLayoutSelection
AcCmdDiagramModifyUserDefinedView
AcCmdDiagramNewLabel
AcCmdDiagramNewTable
AcCmdDiagramRecalculatePageBreaks
AcCmdDiagramShowRelationshipLabels
AcCmdDiagramViewPageBreaks
AcCmdDocMaximize
AcCmdDocMinimize
AcCmdDocMove
AcCmdDocRestore
AcCmdDocSize
AcCmdDocumenter
AcCmdDropSQLDatabase
AcCmdDuplicate
AcCmdEditHyperlink
AcCmdEditingAllowed
AcCmdEditRelationship
AcCmdEditTriggers
AcCmdEditWatch
AcCmdEncryptDecryptDatabase
AcCmdEnd
AcCmdExit
AcCmdExport
AcCmdFavoritesAddTo
AcCmdFavoritesOpen
AcCmdFieldList
AcCmdFilterByForm
AcCmdFilterBySelection
AcCmdFilterExcludingSelection
AcCmdFind
AcCmdFindNext
AcCmdFindNextWordUnderCursor
AcCmdFindPrevious
AcCmdFindPrevWordUnderCursor
AcCmdFitToWindow
AcCmdFont
AcCmdFormatCells
AcCmdFormHdrFtr
AcCmdFormView
AcCmdFreezeColumn
AcCmdGoBack
AcCmdGoContinue
AcCmdGoForward
AcCmdGroupByTable
AcCmdGroupControls
AcCmdHideColumns
AcCmdHidePane
AcCmdHideTable
AcCmdHorizontalSpacingDecrease
AcCmdHorizontalSpacingIncrease
AcCmdHorizontalSpacingMakeEqual
AcCmdHyperlinkDisplayText
AcCmdImport
AcCmdIndent
AcCmdIndexes
AcCmdInsertActiveXControl
AcCmdInsertChart
AcCmdInsertFile
AcCmdInsertFileIntoModule
AcCmdInsertHyperlink
AcCmdInsertLookupColumn
AcCmdInsertLookupField
AcCmdInsertMovieFromFile
AcCmdInsertObject
AcCmdInsertPage
AcCmdInsertPicture
AcCmdInsertPivotTable
AcCmdInsertProcedure
AcCmdInsertQueryColumn
AcCmdInsertRows
AcCmdInsertSpreadsheet
AcCmdInsertSubdatasheet
AcCmdInsertTableColumn
AcCmdInsertUnboundSection
AcCmdInvokeBuilder
AcCmdJoinProperties
AcCmdLastPosition
AcCmdLayoutPreview
AcCmdLineUpIcons
AcCmdLinkedTableManager
AcCmdLinkTables
AcCmdListConstants
AcCmdLoadFromQuery
AcCmdMacroConditions
AcCmdMacroNames
AcCmdMakeMDEFile
AcCmdMaximiumRecords
AcCmdMicrosoftAccessHelpTopics
AcCmdMicrosoftOnTheWeb
AcCmdMicrosoftScriptEditor
AcCmdMoreWindows
AcCmdNewDatabase
AcCmdNewGroup
AcCmdNewObjectAutoForm
AcCmdNewObjectAutoReport
AcCmdNewObjectClassModule
AcCmdNewObjectDataAccessPage
AcCmdNewObjectDiagram
AcCmdNewObjectForm
AcCmdNewObjectFunction
AcCmdNewObjectMacro
AcCmdNewObjectModule
AcCmdNewObjectQuery
AcCmdNewObjectReport
AcCmdNewObjectStoredProcedure
AcCmdNewObjectTable
AcCmdNewObjectView
AcCmdObjBrwFindWholeWordOnly
AcCmdObjBrwGroupMembers
AcCmdObjBrwHelp
AcCmdObjBrwShowHiddenMembers
AcCmdObjBrwViewDefinition
AcCmdObjectBrowser
AcCmdOfficeClipboard
AcCmdOLEDDELinks
AcCmdOLEObjectConvert
AcCmdOLEObjectDefaultVerb
AcCmdOpenDatabase
AcCmdOpenHyperlink
AcCmdOpenNewHyperlink
AcCmdOpenSearchPage
AcCmdOpenStartPage
AcCmdOpenTable
AcCmdOpenURL
AcCmdOptions
AcCmdOutdent
AcCmdOutputToExcel
AcCmdOutputToRTF
AcCmdOutputToText
AcCmdPageHdrFtr
AcCmdPageNumber
AcCmdPageProperties
AcCmdPageSetup
AcCmdParameterInfo
AcCmdPartialReplicaWizard
AcCmdPaste
AcCmdPasteAppend
AcCmdPasteAsHyperlink
AcCmdPasteSpecial
AcCmdPivotAutoAverage
AcCmdPivotAutoCount
AcCmdPivotAutoFilter
AcCmdPivotAutoMax
AcCmdPivotAutoMin
AcCmdPivotAutoStdDev
AcCmdPivotAutoStdDevP
AcCmdPivotAutoSum
AcCmdPivotAutoVar
AcCmdPivotAutoVarP
AcCmdPivotChartByRowByColumn
AcCmdPivotChartDrillInto
AcCmdPivotChartDrillOut
AcCmdPivotChartMultiplePlots
AcCmdPivotChartMultiplePlotsUnifiedScale
acCmdPivotChartShowLegend
acCmdPivotChartType
acCmdPivotChartUndo
acCmdPivotChartView
acCmdPivotCollapse
acCmdPivotDelete
acCmdPivotDropAreas
acCmdPivotExpand
acCmdPivotRefresh
acCmdPivotShowAll
acCmdPivotShowBottom1
acCmdPivotShowBottom10
acCmdPivotShowBottom10Percent
acCmdPivotShowBottom1Percent
acCmdPivotShowBottom2
acCmdPivotShowBottom25
acCmdPivotShowBottom25Percent
acCmdPivotShowBottom2Percent
acCmdPivotShowBottom5
acCmdPivotShowBottom5Percent
acCmdPivotShowBottomOther
acCmdPivotShowTop1
acCmdPivotShowTop10
acCmdPivotShowTop10Percent
acCmdPivotShowTop1Percent
acCmdPivotShowTop2
acCmdPivotShowTop25
acCmdPivotShowTop25Percent
acCmdPivotShowTop2Percent
acCmdPivotShowTop5
acCmdPivotShowTop5Percent
acCmdPivotShowTopOther
acCmdPivotTableClearCustomOrdering
acCmdPivotTableCreateCalcField
acCmdPivotTableCreateCalcTotal
acCmdPivotTableDemote
acCmdPivotTableExpandIndicators
acCmdPivotTableExportToExcel
acCmdPivotTableFilterBySelection
acCmdPivotTableGroupItems
acCmdPivotTableHideDetails
acCmdPivotTableMoveToColumnArea
acCmdPivotTableMoveToDetailArea
acCmdPivotTableMoveToFilterArea
acCmdPivotTableMoveToRowArea
acCmdPivotTablePercentColumnTotal
acCmdPivotTablePercentGrandTotal
acCmdPivotTablePercentParentColumnItem
acCmdPivotTablePercentParentRowItem
acCmdPivotTablePercentRowTotal
acCmdPivotTablePromote
acCmdPivotTableRemove
acCmdPivotTableShowAsNormal
acCmdPivotTableShowDetails
acCmdPivotTableSubtotal
acCmdPivotTableUngroupItems
acCmdPivotTableView
acCmdPreviewEightPages
acCmdPreviewFourPages
acCmdPreviewOnePage
acCmdPreviewTwelvePages
acCmdPreviewTwoPages
acCmdPrimaryKey
acCmdPrint
acCmdPrintPreview
acCmdPrintRelationships
acCmdProcedureDefinition
acCmdPromote
acCmdProperties
acCmdPublish
acCmdPublishDefaults
acCmdQueryAddToOutput
acCmdQueryGroupBy
acCmdQueryParameters
acCmdQueryTotals
acCmdQueryTypeAppend
acCmdQueryTypeCrosstab
acCmdQueryTypeDelete
acCmdQueryTypeMakeTable
acCmdQueryTypeSelect
acCmdQueryTypeSQLDataDefinition
acCmdQueryTypeSQLPassThrough
acCmdQueryTypeSQLUnion
acCmdQueryTypeUpdate
acCmdQuickInfo
acCmdQuickPrint
acCmdQuickWatch
acCmdRecordsGoToFirst
acCmdRecordsGoToLast
acCmdRecordsGoToNew
acCmdRecordsGoToNext
acCmdRecordsGoToPrevious
acCmdRecoverDesignMaster
acCmdRedo
acCmdReferences
acCmdRefresh
acCmdRefreshPage
acCmdRegisterActiveXControls
acCmdRelationships
acCmdRemove
acCmdRemoveFilterSort
acCmdRemoveTable
acCmdRename
acCmdRenameColumn
acCmdRenameGroup
acCmdRepairDatabase
acCmdReplace
acCmdReportHdrFtr
acCmdReset
acCmdResolveConflicts
acCmdRestore
acCmdRowHeight
acCmdRun
acCmdRunMacro
acCmdRunOpenMacro
acCmdSave
acCmdSaveAllModules
acCmdSaveAllRecords
acCmdSaveAs
acCmdSaveAsASP
acCmdSaveAsDataAccessPage
acCmdSaveAsHTML
acCmdSaveAsIDC
acCmdSaveAsQuery
acCmdSaveAsReport
acCmdSaveLayout
acCmdSaveModuleAsText
acCmdSaveRecord
acCmdSelectAll
acCmdSelectAllRecords
acCmdSelectDataAccessPage
acCmdSelectForm
acCmdSelectRecord
acCmdSelectReport
acCmdSend
acCmdSendToBack
acCmdServerFilterByForm
acCmdServerProperties
acCmdSetControlDefaults
acCmdSetDatabasePassword
acCmdSetNextStatement
acCmdShowAllRelationships
acCmdShowDirectRelationships
acCmdShowEnvelope
acCmdShowMembers
acCmdShowNextStatement
acCmdShowOnlyWebToolbar
acCmdShowTable
acCmdSingleStep
acCmdSizeToFit
acCmdSizeToFitForm
acCmdSizeToGrid
acCmdSizeToNarrowest
acCmdSizeToWidest
acCmdSnapToGrid
acCmdSortAscending
acCmdSortDescending
acCmdSortingAndGrouping
acCmdSpeech
acCmdSpelling
acCmdSQLView
acCmdStartupProperties
acCmdStepInto
acCmdStepOut
acCmdStepOver
acCmdStepToCursor
acCmdStopLoadingPage
acCmdSubdatasheetCollapseAll
acCmdSubdatasheetExpandAll
acCmdSubdatasheetRemove
acCmdSubformDatasheet
acCmdSubformDatasheetView
acCmdSubformFormView
acCmdSubformInNewWindow
acCmdSubformPivotChartView
acCmdSubformPivotTableView
acCmdSwitchboardManager
acCmdSynchronizeNow
acCmdTabControlPageOrder
acCmdTableAddTable
acCmdTableCustomView
acCmdTableNames
acCmdTabOrder
acCmdTestValidationRules
acCmdTileHorizontally
acCmdTileVertically
acCmdToggleBreakPoint
acCmdToggleFilter
acCmdToolbarControlProperties
acCmdToolbarsCustomize
acCmdTransferSQLDatabase
acCmdTransparentBackground
acCmdTransparentBorder
acCmdUndo
acCmdUndoAllRecords
acCmdUnfreezeAllColumns
acCmdUngroupControls
acCmdUnhideColumns
acCmdUpsizingWizard
acCmdUserAndGroupAccounts
acCmdUserAndGroupPermissions
acCmdUserLevelSecurityWizard
acCmdVerticalSpacingDecrease
acCmdVerticalSpacingIncrease
acCmdVerticalSpacingMakeEqual
acCmdViewCode
acCmdViewDataAccessPages
acCmdViewDetails
acCmdViewDiagrams
acCmdViewFieldList
acCmdViewForms
acCmdViewFunctions
acCmdViewGrid
acCmdViewLargeIcons
acCmdViewList
acCmdViewMacros
acCmdViewModules
acCmdViewQueries
acCmdViewReports
acCmdViewRuler
acCmdViewShowPaneDiagram
acCmdViewShowPaneGrid
acCmdViewShowPaneSQL
acCmdViewSmallIcons
acCmdViewStoredProcedures
acCmdViewTableColumnNames
acCmdViewTableColumnProperties
acCmdViewTableKeys
acCmdViewTableNameOnly
acCmdViewTables
acCmdViewTableUserView
acCmdViewToolbox
acCmdViewVerifySQL
acCmdViewViews
acCmdVisualBasicEditor
acCmdWebPagePreview
acCmdWebPageProperties
acCmdWebTheme
acCmdWindowArrangeIcons
acCmdWindowCascade
acCmdWindowHide
acCmdWindowSplit
acCmdWindowUnhide
acCmdWordMailMerge
acCmdWorkgroupAdministrator
acCmdZoom10
acCmdZoom100
acCmdZoom1000
acCmdZoom150
acCmdZoom200
acCmdZoom25
acCmdZoom50
acCmdZoom500
acCmdZoom75
acCmdZoomBox
acCmdZoomSelection
Comentarios
Cada comando de menú y de barra de herramientas de Microsoft Access tiene una constante asociada que puede utilizar con el método RunCommand para ejecutar ese comando desde Visual Basic.
No puede usar el método RunCommand para ejecutar un comando en un menú o barra de herramientas personalizada. Sólo puede usarlo con menús y barras de herramientas integradas.
El método RunCommand reemplaza al método DoMenuItem del objeto DoCmd.
Ejemplo
El ejemplo siguiente utiliza el método RunCommand para abrir el cuadro de diálogo Opciones (menú Herramientas).
Public Function OpenOptionsDialog() As Boolean
On Error GoTo Error_OpenOptionsDialog
DoCmd.RunCommand acCmdOptions
OpenOptionsDialog = True
Exit_OpenOptionsDialog:
Exit Function
Error_OpenOptionsDialog:
MsgBox Err & ": " & Err.Description
OpenOptionsDialog = False
Resume Exit_OpenOptionsDialog
End Function
La opción para combinar con MS Word es:
AcCmdWordMailMerge
- Compartir respuesta
- Anónimo
ahora mismo