K
kiln
From MS Access 2000 I'm opening word 2000 docs via code, and inspecting
the BuiltInDocumentProperties("Keywords") property. In theory I change
nothing in the doc. However when I try to close the active document, a
dialog pops up suggesting I save the doc I'd opened via code as
"NAME.doc". Can't figure out why? Something triggered by looking into
BuiltInDocumentProperties? Calling .Save doesn't seem to help, and that
seems wrong anyways...
Code snippet:
dim objWord as Object
' etc other vars
Set objWord = CreateObject("Word.Application")
strDir = "C:\"
strDirFileRequest = strDir & "*.doc"
strFileName = Dir(strDirFileRequest)
Do While strFileName <> ""
strPathFileName = strDir & strFileName
objWord.Documents.Add strPathFileName
strDocKeywords = objWord.ActiveDocument.BuiltInDocumentProperties
("Keywords")
if strDocKeywords = "Something" then
'whatever, nothing to do with Word
end if
objWord.ActiveDocument.Close
strFileName = Dir
Loop
set objWord = Nothing
the BuiltInDocumentProperties("Keywords") property. In theory I change
nothing in the doc. However when I try to close the active document, a
dialog pops up suggesting I save the doc I'd opened via code as
"NAME.doc". Can't figure out why? Something triggered by looking into
BuiltInDocumentProperties? Calling .Save doesn't seem to help, and that
seems wrong anyways...
Code snippet:
dim objWord as Object
' etc other vars
Set objWord = CreateObject("Word.Application")
strDir = "C:\"
strDirFileRequest = strDir & "*.doc"
strFileName = Dir(strDirFileRequest)
Do While strFileName <> ""
strPathFileName = strDir & strFileName
objWord.Documents.Add strPathFileName
strDocKeywords = objWord.ActiveDocument.BuiltInDocumentProperties
("Keywords")
if strDocKeywords = "Something" then
'whatever, nothing to do with Word
end if
objWord.ActiveDocument.Close
strFileName = Dir
Loop
set objWord = Nothing