Skip to main content
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum

developerWorks

  

Sign in to participate PreviousPrevious NextNext

RE: Ebedded attchment
db sh 22.Jun.12 11:08 AM a Web browser
Applications Development All Releases All Platforms


Dear Ram,

Hiii this is my code

Here CommentsHT is my richtext field and i have commented peace of code coz that code was not working

Dim session As New NotesSession
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim view As NotesView
Dim xlApp As Variant
Dim workbook As Variant
Dim row As Integer
Dim language As String
Dim namforEnteredBy As NotesName

Set uidoc=workspace.CurrentDocument
Set db = session.CurrentDatabase
Set doc=uidoc.Document
Set namforEnteredBy=session.CreateName(doc.EnteredBy(0))
row=1



Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = False
Set workbook = xlApp.Workbooks
workbook.Add
Set excelsheet = xlApp.Workbooks(1).Worksheets(1)


'set the lables of excel sheet

CreationDate="Creation Date"

xlApp.cells(row,1).Value = CreationDate


xlApp.rows("1:1").Select
xlApp.selection.Font.Bold=True
xlApp.Selection.Font.Size=9
xlApp.Selection.columns.autofit

row=row+2

'fill the excel sheet with data from docs--------------------------------------------------------------------------------------------
xlApp.cells(row,1).Value = doc.GetItemValue("CreationDate")(0)

%REM
Dim countembeded As Integer
Dim countattachments As Integer
Dim rtitem As Variant


countembedded=0
If doc.HasEmbedded Then
Forall o In doc.CommentsHT
countembedded=countembedded+1
' Messagebox( o.Name )
End Forall
'Else
' Messagebox "No embedded objects found"
End If
''worksheet.range("I"+Ltrim(Str(row))).value=countembedded
xlApp.cells(row,21).Value = countembedded


Set rtitem = doc.GetFirstItem("Body")
countattachments=0
If ( rtitem.Type = RICHTEXT ) Then
Forall o In rtitem.EmbeddedObjects
If ( o.Type = EMBED_ATTACHMENT ) _
And ( o.FileSize > MAX ) Then
countattachments=countattachments+1
' Call o.ExtractFile ( "c:\reports\newfile" & Cstr(fileCount) )
' Call o.Remove
' Call doc.Save( True, True )
End If
End Forall
End If

''worksheet.range("H"+Ltrim(Str(row))).value=countattachments

xlApp.cells(row,19).Value = countattachments
%END REM
xlApp.cells(row,19).Value = doc.GetItemValue("CommentsHT")(0)



''row = row + 1
''Set doc = view.GetNextDocument(doc)
''Wend
xlApp.rows("1:100").Select
xlApp.Selection.columns.autofit
xlApp.rows("1:1").select

Dim fileNum As Integer
Dim fileName As String

fileNum% = Freefile()

Dim userdirectory As String
Dim userdrive As String
userdirectory = session.GetEnvironmentString("Directory",True)


'Msgbox "Userdirectoy is " & userdirectory

If (userdirectory Like "C:\*") Or (userdirectory Like "c:\*") Then
userdrive="c:\ExcelSheet.xls"
xlApp.activeworkbook.SaveAs("c:\ExcelSheet.xls")
Else
If (userdirectory Like "g:\*") Or (userdirectory Like "G:\*") Then
userdrive="g:\ExcelSheet.xls"
xlApp.activeworkbook.SaveAs("g:\ExcelSheet.xls")
End If
End If

'' Write #fileNum%
'' Close fileNum%

''xlApp.activeworkbook.SaveAs ("d:\ExcelSheet.xls.xls")
xlApp.quit
Exit Function




Ebedded attchment (db sh 20.Jun.12)
. . RE: Ebedded attchment (MALLIK R PERVEL... 22.Jun.12)
. . . . RE: Ebedded attchment (db sh 22.Jun.12)


Document Options






  Document options
Print this pagePrint this page

Search this forum

Forum views and search


  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Author
Category
Platform
Release
Advanced search

Sign In or Register

 Sign In or Register
Sign in
Forgot your password?
Forgot your user name?
Create new registration

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds

Resources

 Resources
Forum use and etiquette
Native Notes Access
Web site Feedback

Lotus Support

 Lotus Support
IBM Support Portal - Lotus software
Lotus Support documents
Lotus support by product
Lotus support downloads
Lotus support RSS feeds

Wikis

 Wikis
IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

Lotus Forums


 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
Notes/Domino 4 and 5
IBM Connections
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
IBM SmartCloud Meetings
IBM Web Content Manager
Lotus Domino Document Manager
Lotus e-learning
Lotus Enterprise Integration
Lotus Expeditor
Lotus Protector
Lotus Quickr
Lotus SmartSuite
Lotus Symphony
Lotus Symphony Developer Toolkit Support
Lotus Workflow