strOutputPath = GetOutputDocsPath()Select Case intFileTypeCase 1HTMLstrFileName = “Jobs.htm”
strFileNameAndPath = strOutputPath & strFileName
DoCmd.TransferText transfertype:=acExportHTML, _
TableName:=strQuery, _
FileName:=strFileNameAndPath, _
hasfieldnames:=TrueCase 2XMLstrFileName = “Jobs.xml”
strFileNameAndPath = strOutputPath & strFileName
ExportXML objecttype:=acExportQuery, _
DataSource:=strQuery, _
datatarget:=strFileNameAndPathEnd SelectstrTitle = “Exported jobs”
strPrompt = “Exported filtered jobs to “ & strFileNameAndPath
MsgBox strPrompt, vbInformation + vbOKOnly, strTitleErrorHandlerExit:
Exit SubErrorHandler:
MsgBox “Error No: “ & Err.Number _
& “; Description: “ & Err.Description
Resume ErrorHandlerExitEnd SubIf you open an XML file in IE 7, running on Windows Vista, you’ll see a yellow bar with a security
warning. If you click the bar you can select to allow blocked content, as shown in Figure 10.28.Part II Writing VBA Code to Exchange Data between Office Components