Home > Ask the Domino Experts > Lotus Instant Messaging/Sametime Questions & Answers > Can I compose a doc within a source doc and have it inherit an RTF?
Ask The Domino Expert: Questions & Answers
EMAIL THIS

Can I compose a doc within a source doc and have it inherit an RTF?

Hans van der Burg EXPERT RESPONSE FROM: Hans van der Burg

Pose a Question
Other Domino Categories
Meet all Domino Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 18 August 2003
I'm trying to compose a document from within the source document and have it inherit an Rich Text field. So I'm at QueryClose and it still does not come into the new UIdoc, even after I saved and reopened new UIdoc. I need to get the RTF into my new document.
Dim sourceitem  As NotesItem
  Set sourceitem = doc.GetFirstItem( "Text" )
  Dim docnew As NotesDocument
  Set Docnew = uidoc.document
  If Not sourceitem  Is Nothing Then
   Msgbox "call sourceitem"   
   Call sourceitem .CopyItemToDocument
( docnew , "" )
  End If

>
I am a bit puzzled by your question and the code. When I look at the code, there is nothing there that shows me you are composing a new document. In fact, you are copying the RichTextItem to the backend class of the current UIdocument. Doing so can even cause save-conflicts, as you are working on both instances at the same time.

The following is some sample code, which shows you how to copy an RTF field to another document and then open that document in edit mode to the user. Hope this will help.

 Dim s As New notesSession
 Dim w As New notesUIWorkspace
 
 Dim myDb As notesDatabase
 Dim uidoc As notesUIDocument
 Dim doc As notesDocument
 Dim newDoc As notesDocument
 Dim targetBody As notesRichTextItem
 Dim sourceBody As notesRichTextItem
 
 Set myDb = s.currentDatabase
 Set uidoc = ws.currentDocument
 Set doc = uidoc.Document
 Set sourceBody =doc.GetFirstItem
("Body")
 
 Set newDoc = New notesDocument
(myDb)
 newDoc.Form = "myForm"
 newDoc.Field1 = Doc.Field1(0)
 Set targetBody = New NotesRichTextItem
(newDoc, "Body")
 Call targetBody.AppendText
("This is a new document:")
 Call targetBody.AddNewLine(2)
 Call targetBody.AppendRTItem
(sourceBody)
 
 ' to clear memory in Domino
 Delete targetBody
 '********************************
 Call ws.EditDocument(True, newDoc)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Lotus Instant Messaging/Sametime
How to enable communication between multiple Lotus Sametime servers
Lotus Sametime users with different 'home' servers cannot see each other online
Resources for deploying Lotus Sametime on the Internet
No one can see Lotus Sametime user is online
Meeting windows won't appear on Sametime 7 with Sametime Connect 3 client
Saving and archiving Lotus Sametime Web conferences
Collaborating with clients who don't have Sametime
Unable to log into Sametime through Notes with SSO
Can Lotus Notes leverage domain authentication?
Updating local location documents for Sametime users

LotusScript
LotusScript agent parses ACL to Microsoft Notepad
LotusScript finds the first occurrence of a string from the right
Clear Recent Contacts view and prevent repopulation in Lotus Notes 8.x
Search Microsoft Active Directory with LotusScript
Three steps to trap and handle save conflicts with LotusScript
Troubleshoot agents by displaying LotusScript variables online
LotusScript sorts lists alphabetically
Run or restart Notes/Domino agents via text messages
LotusScript code rebuilds corrupted busytime.nsf file
Soft-code item names to facilitate LotusScript management

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



Lotus Notes Domino on Blackberry and mobile devices
HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts