Hi
I found the following code below. It works quite well as it does create a word document. I however need to do the following and I am very stuck…spend quite a while searching on site but not found anything similar.
I am created a document in a notes database, need to then click on an action button and want the contents of my document, it is really a quotation to be copied into a work document. Once this is done I would like an attachment to be created on the fly and a new memo (have the code for this) just need to create the word document and attachment on the fly. Do you think this is possible to achieve?
Thanks in advance.
Coll
See code found below that creates a blank word document…
Sub Click(Source As Button)
Dim word_app As Variant
Dim word_document As Variant
Dim activedoc As Variant
Set word_app = CreateObject("Word.Application")
If word_app Is Nothing Then
word_app.quit
End If
'Create a new document
word_app.Documents.Add
'Retrieve handle to current document
Set activedoc = word_app.ActiveDocument
'Set the current dir where u want
'to save the document.
path = "c:\lotus\notes\data\domino"
Chdir path
word_app.ActiveDocument.Saveas(Curdir()+"\"+"Quotation"+".doc")
word_app.visible = True
word_app.quit
Set word_app = Nothing
Set activedoc = Nothing
End Sub