Access.2007.VBA.Bibl..
TABLE 17.1 Syntax Differences between VBA and VBS Code Category Omitted Feature/Keyword Array Handling Option Base Declaring arr ...
TABLE 17.2 Programming Technique Differences between VBA and VBS Code VBA Feature VBS Feature All named constants can be used On ...
Part III Adding More Functionality to Office Using GetObject and CreateObject in VBS I n VBA code, you can use GetObjectto set a ...
FIGURE 17.11 Viewing the numeric equivalents of named constants in the OlObjectClassOutlook enum in the Object Browser. Useful S ...
Part III Adding More Functionality to Office Setting the User Templates and Workgroup Templates Paths T o view (or set) the User ...
Creating Standalone Scripts with Windows Script Host 17 The Advanced page of the Word Options dialog. The File Locations dialog ...
To test one of these scripts, copy the Test.dot template to the same folder as the script (you can also copy any Word template, ...
FIGURE 17.14 A success message after copying the template to the User Templates path. If the copy could not be done, because Tes ...
Get the path of the current script, extracting it from the ScriptFullNameproperty: strScriptNameAndPath = WScript.ScriptFullName ...
Dim strScriptPath Dim strScriptName Dim strScriptNameAndPath Dim fil Dim strPrompt Dim strTemplatePath Dim strCurrentPath strScr ...
Else strPrompt = _ “Workgroup template path not selected; canceling” MsgBox strPrompt, vbCritical + vbOKOnly End If One or the o ...
Copy all Word 2007 (*.dotx) templates from the current folder to User Templates folder, with a message box for each one (comment ...
Else ‘Print report appAccess.DoCmd.OpenReport “rptCustomerLabels” End If Set appAccess = Nothing If the MSE is already open, you ...
& “qryInvoices.ShipCountry, “ _ & “qryInvoices.CustomerID, qryInvoices.CompanyName, “ _ & “qryInvoices.BillToAddress ...
FIGURE 17.17 An Access report printed from a WSH script. As a quick alternative to opening Word or Excel and selecting the corre ...
strTemplate = “Test Letter.dot” Set appWord = WScript.CreateObject(“Word.Application”) Get the User Templates path from the Word ...
Get the User Templates path from the Word Options dialog. Set appWord = WScript.CreateObject(“Word.Application”) strUserTemplate ...
strFile = “aadownload.log” strFilePath = strPath & strFile If fso.FileExists(strFilePath) Then fso.DeleteFile strFilePath bl ...
Set fso = CreateObject(“Scripting.FileSystemObject”) Set fldTemp = fso.GetSpecialFolder(2) strPrompt = “Delete all files in “ &a ...
Modify the following line as needed for your requirements: strNewFileName = Mid(fil.Name, 9) fil.Name = strNewFileName lngCount ...
«
27
28
29
30
31
32
33
34
35
36
»
Free download pdf