I am in need of more assistance. I am not trying to copy the readers and authors fields from one document to another and it is putting them as text into the new fields on the new document. Can someone help me and enlighten me on how to Get the readers and authors field and then Set those fields on the new document?
Here is the code:
Sub Initialize
Dim session As New NotesSession
' Dim CMSdb As New NotesDatabase( "", "cacms.nsf" ) 'db set right here
' Dim CMSIIdb As New NotesDatabase("", "CMSII.nsf") 'db set here
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument
Dim ws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim view As NotesView
Dim j As Integer
Set session = New NotesSession
Set ws = New NotesUIWorkspace
Set db= session.CurrentDatabase
Set view = db.GetView("MainView")
Set collection =db.UnprocessedDocuments
For j = 1 To collection.Count
Set doc = collection.GetNthDocument(j)
' get the fields from the CMS document
Set ActType = doc.GetFirstItem( "ActivityType" )
Set CName = doc.GetFirstItem("Company")
Set CoType = doc.GetFirstItem("CompanyType")
Set ETitle = doc.GetFirstItem("Subject")
Set DETAILS = doc.GetFirstItem("Details")
Set TOPIC = doc.GetFirstItem("Events")
Set Att = doc.GetFirstItem("Attendees")
Set Ag = doc.GetFirstItem("Agenda")
Set Objec = doc.GetFirstItem("Objective")
Set SubTop = doc.GetFirstItem("Location")
Set D = doc.GetFirstItem("Dates")
Set STime = doc.GetFirstItem("Time1")
Set ETime = doc.GetFirstItem("Time2")
Set Dur = doc.GetFirstItem("Duration")
Set WBeg = doc.GetFirstItem("WeekBeginning")
' Set Com = doc.GetFirstItem("Comment")
Set iRep = doc.GetFirstItem("IRep")
Set rep = doc.GetFirstItem("Rep")
********** These two statements are where it is getting the readers and authors fields from the document ***********
Set Reader = doc.GetFirstItem("DocReaders")
Set Author = doc.GetFirstItem("DocAuthors")
'Compose the CMS II document --- have to define the exact form that you want
Set uidoc = ws.ComposeDocument _
( "Domino/Cardinal", "CMS\CMS2.nsf", "Activity" )
' Set the data on the CMSII document
Call uidoc.FieldSetText("CoName", CName.Text)
Call uidoc.FieldSetText("CType", CoType.Text)
Call uidoc.FieldSetText("AType", ActType.Text)
Call uidoc.FieldSetText("DisplayInfo", CType + " for " + CoName)
Call uidoc.FieldSetText("DisplayInfo1", "Customer Management System II--- Activity")
Call uidoc.RefreshHideFormulas
Call uidoc.Refresh
Call uidoc.FieldSetText("EventTitle", ETitle.Text)
Call uidoc.FieldSetText("Details", DETAILS.Text)
Call uidoc.FieldSetText("Topic", TOPIC.Text)
Call uidoc.FieldSetText("Attendees", Att.Text)
Call uidoc.FieldSetText("Agenda", Ag.Text)
Call uidoc.FieldSetText("Objective", Objec.Text)
Call uidoc.FieldSetText("SubTopic", SubTop.Text)
Call uidoc.FieldSetText("Date", D.Text)
Call uidoc.FieldSetText("StartTime", STime.Text)
Call uidoc.FieldSetText("EndTime", ETime.Text)
Call uidoc.FieldSetText("Duration", Dur.Text)
Call uidoc.FieldSetText("WeekBeginning", WBeg.Text)
' Call uidoc.FieldSetText("Comment", Com.Text)
Call uidoc.FieldSetText("IRep", iRep.Text)
Call uidoc.FieldSetText("Rep", rep.Text)
************* This is where it is pasting the data as text and not formatting it as a readers field **********
Call uidoc.FieldSetText("DocReaders", Reader.Text + "Jamie Augustus/Cardinal")
************* This is where it is pasting the data as text and not formatting it as a authors field **********
Call uidoc.Fieldsettext("DocAuthors", Author.Text + "Jamie Augustus/Cardinal")
' do things to the doc the refresh, save, and close the doc
Call uidoc.Refresh
Call uidoc.RefreshHideFormulas
Call uidoc.Save
Call uidoc.Close(True)
Next j
End Sub
Again, need help to “paste” the data in the fields as the readers and authors data so that the secturity may be set.
Thanks and any help is appericated!!!