I am only just beginning with Notes and Automation, so please bear with me. Firstly I’m not even sure if this is the right Forum to be asking this question in, anyway:
I would like to send an MSWord file,using VBA and a CommandButton “Send to Notes” to a Notes database called “CCWorkdesk” (replica is on my PC).
The file would be attached to a “Visit Report” (category within the DB) which has a Form called “VR” to be filled in for each visit, with some other info. This other info will also be transmitted from the button’s VBA code.
Can somebody kindly set me off in the right direction, such as how to Open this database from MSWord VBA ?
Further help would also be appreciated of course but I think that once I can open it then I should be able continue (struggle!) on my own.
Subject: Sending from MSWord97 to Lotus Notes Database
Not word but following outlook macro moves selected outlook mails as attachments to my mail db. Should get you started.
Sub MoveToNotes()
Const DBNAME = "mail\hparker.nsf"
Const DBSERVER = "AC02"
Dim ss As New NotesSession
Dim DB As NotesDatabase
Dim doc As NotesDocument
Dim it As NotesRichTextItem
Dim it2 As NotesRichTextItem
On Error GoTo lerr
Call ss.Initialize
Set DB = ss.GetDatabase(DBSERVER, DBNAME, False)
Set myOlSel = Application.ActiveExplorer.Selection
If myOlSel.Count = 0 Then
MsgBox "no documents selected?"
Else
For i = 1 To myOlSel.Count
myOlSel.Item(i).SaveAs "c:\outl.msg", 3
Set doc = DB.CreateDocument
Call doc.ReplaceItemValue("Form", "Memo")
Call doc.ReplaceItemValue("Subject", myOlSel.Item(i).Subject)
Call doc.ReplaceItemValue("From", "From: " + myOlSel.Item(i).SenderName)
Set it = doc.CreateRichTextItem("Body")
Call it.EmbedObject(1454, "", "c:\outl.msg")
Call doc.Save(True, False)
Next
MsgBox Format$(myOlSel.Count) + " documents moved to db: " + DBNAME
End If