WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE with Word

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Template Info in Word

 Keywords:  Template Directories Info Associated Word

Example 1:

; Gets template directories from Word
; Same values as found under the menu Tools|Options|FileLocations

wdWorkgroupTemplatesPath = 3
wdUserTemplatesPath = 2
appWord = ObjectOpen("Word.Application")
oOptions = appWord.Options
PathUserTemplates=oOptions.DefaultFilePath(wdUserTemplatesPath)
PathWorkgroupTemplates=oOptions.DefaultFilePath(wdWorkgroupTemplatesPath)
appWord.Quit
ObjectClose(oOptions)
ObjectClose(appWord)

Message("Template paths",StrCat("User Templates: ",PathUserTemplates,@Crlf,@Crlf,"Workgroup Templates: ",PathWorkgroupTemplates))
exit

Example 2:

;Gets the Currently loaded documents Associated template

appWord = ObjectOpen("Word.Application")
appWord.visible = @false
docname = "C:\temp\sysparam.doc"
docs = appWord.documents
docs.open(docname)
activedoc = appWord.activedocument
bidp = activedoc.builtindocumentproperties(6); Template
template = bidp.value
message("Pages in %docname%", template)
docs.close
appWord.quit
objectclose(activedoc)
objectclose(appWord)
exit

Article ID:   W15268
File Created: 2002:09:20:07:30:48
Last Updated: 2002:09:20:07:30:48