I got a problem, im geting data from an excel sheet and i want to paste it inside my rich text table.
How can i do it?
Im only able to paste it afterwards, ive tried a few things but was never able to.
Any help is greatly appreciated.
Thanks
my code is as following
Set session = CreateObject("notes.NOTESSESSION")
Set ws = CreateObject("notes.notesUiWorkspace")
Mailfile = session.GETENVIRONMENTSTRING("MailFile", True)
Mailserver = session.GETENVIRONMENTSTRING("MailServer", True)
Set db = session.GETDATABASE(server, MailFile)
'Set noDatabase = ws.CurrentDatabase
Set NotesDoc = db.CreateDocument
Set doc=NotesDoc.CreateRichTextItem("Body")
notesdoc.subject="morning"
notesdoc.sendto="******.com"
With NotesDoc
.ComputeWithForm False, False
.SaveMessageOnSend = True
.Save True, False, True
'.SaveOptions = "0"
End With
'----===== test
Set doc = NotesDoc.GetFirstItem("Body")
Set rtnav = doc.CreateNavigator
Set rstyle=session.CreateRichTextStyle
Dim rows As Integer, columns As Integer
rows = 4
columns = 1
Call doc.AppendTable(rows, columns, fldHeader)
Call rtnav.FindFirstElement(RTELEM_TYPE_TABLECELL)
rstyle.Bold=True
rstyle.NotesColor=COLOR_BLUE
rstyle.FontSize=10
Call doc.AppendStyle(rstyle)
doc.update
Msgbox ""
For i=0 To Ubound(fldHeader)
Call doc.BeginInsert(rtnav)
doc.appendtext("A")
If i=1 Then
'want to paste data in here
'paste my data in here
End If
Call doc.EndInsert
Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL)
Next
Call doc.update
Set uiDoc = WS.EDITDOCUMENT(False,NotesDoc)
uiDoc.GOTOFIELD("Body")
'---==== ====---'
'---==== Excel ====---'
'---==== ====---'
Dim xlApp As Variant, sheet As Variant, xlwb As Variant, xlrange As Variant
Dim filename As String, currentvalue As String
Dim batchRows As Integer, batchColumns As Integer, totalColumns As Integer
Dim x As Integer, y As Integer, startrow As Integer
Dim curRow As Long, timer1 As Long, timer2 As Long
Dim DataArray, fieldNames, hasData
Dim outputtxt As String
filename="C:\Documents and Settings\Administrator\My Documents\=STUFF\MANDATORY\Mandatory Master.xls"
batchRows=200 'process 200 rows at a time
Set db = session.CurrentDatabase
Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True
Set xlwb=xlApp.Workbooks.Open(filename)
Set sheet =xlwb.Worksheets(4)
xlApp.ActiveSheet.range("n1:t25").copy
uidoc.paste
xlApp.ActiveSheet.Application.CutCopyMode = False
Call xlApp.Quit()