[AccessD] Automation Problem - Closing Word

MartyConnelly martyconnelly at shaw.ca
Sat Apr 7 12:19:45 CDT 2007


Add this line

  objWord.Documents.Close
  objWord.Quit
  Set objWord = Nothing



Rocky Smolin at Beach Access Software wrote:

>Dear List:
> 
>I am getting the text of a document into a string variable from a word doc.
>Then I want to close word.  I get the text of the document OK (which then
>goes into an email). 
> 
>But with the code below, the document closes but Word says open.    How can
>I get WORD closed up?
> 
>    Dim objWord As Object
>    
>    ' Get the body text
>    Set objWord = CreateObject("Word.Application")
>    objWord.Documents.Open (argDocument)
>    objWord.Selection.WholeStory
>    strBody = objWord.Selection
>    'MsgBox strBody
>    objWord.Documents.Close
>    Set objWord = Nothing
>
> 
>MTIA
> 
>Rocky
> 
>
>
> 	
>	
>  
>

-- 
Marty Connelly
Victoria, B.C.
Canada




More information about the AccessD mailing list