Autor Thema: error when I try to copy an intern field  (Gelesen 1924 mal)

Offline Toma Bogdan

  • Aktives Mitglied
  • ***
  • Beiträge: 146
  • Geschlecht: Männlich
  • That's me ...
    • A nice site !
error when I try to copy an intern field
« am: 11.06.04 - 15:13:36 »
I receive the following error (attached file) when I try to copy an intern field

the code is:
Code
Set item_File = doc.GetFirstItem( "$File" )
If Not item_File  Is Nothing Then Call item_File.CopyItemToDocument( docnou, "$File" )
« Letzte Änderung: 11.06.04 - 15:14:03 von Toma Bogdan »

Glombi

  • Gast
Re:error when I try to copy an intern field
« Antwort #1 am: 11.06.04 - 15:21:34 »
You have to copy the rich text field:

Example from Notes 5 Designer Help:

Dim docA As NotesDocument
Dim docB As NotesDocument
Dim rtitemA As Variant
Dim rtitemB As Variant
'...set values of docA and docB...
Set rtitemA = docA.GetFirstItem( "Body" )
Set rtitemB = docB.GetFirstItem( "Body" )
If ( rtitemA.Type = RICHTEXT And _
rtitemB.Type = RICHTEXT ) Then
  Call rtitemA.AppendRTItem( rtitemB )
  Call docB.Save( False, True )
End If

Andreas

Offline Toma Bogdan

  • Aktives Mitglied
  • ***
  • Beiträge: 146
  • Geschlecht: Männlich
  • That's me ...
    • A nice site !
Re:error when I try to copy an intern field
« Antwort #2 am: 11.06.04 - 15:29:02 »
You have to copy the rich text field:

Example from Notes 5 Designer Help:

Dim docA As NotesDocument
Dim docB As NotesDocument
Dim rtitemA As Variant
Dim rtitemB As Variant
'...set values of docA and docB...
Set rtitemA = docA.GetFirstItem( "Body" )
Set rtitemB = docB.GetFirstItem( "Body" )
If ( rtitemA.Type = RICHTEXT And _
rtitemB.Type = RICHTEXT ) Then
  Call rtitemA.AppendRTItem( rtitemB )
  Call docB.Save( False, True )
End If

Andreas
I receive the error Object variable not set at line rtitemB.Type = RICHTEXT ) Then !

PS. why my method works (in a similiar way with this method) for the Body field ?

Offline TMC

  • Freund des Hauses!
  • Gold Platin u.s.w. member:)
  • *****
  • Beiträge: 3.660
  • Geschlecht: Männlich
  • meden agan
Re:error when I try to copy an intern field
« Antwort #3 am: 11.06.04 - 15:31:13 »
Toma,

There is no need to copy the $File - items. Just copy the Body-Richtext-Item via

Set itemMyBody = doc.GetFirstItem( "Body" )
If Not itemMyBody  Is Nothing Then Call itemBody.CopyItemToDocument( docnou, "BodyNew" )

The $File - items will be created automatically when you save the target document.
Matthias

A good programmer is someone who looks both ways before crossing a one-way street.


Offline Toma Bogdan

  • Aktives Mitglied
  • ***
  • Beiträge: 146
  • Geschlecht: Männlich
  • That's me ...
    • A nice site !
Re:error when I try to copy an intern field
« Antwort #4 am: 11.06.04 - 15:38:56 »
Toma,

There is no need to copy the $File - items. Just copy the Body-Richtext-Item via

Set itemMyBody = doc.GetFirstItem( "Body" )
If Not itemMyBody  Is Nothing Then Call itemBody.CopyItemToDocument( docnou, "BodyNew" )

The $File - items will be created automatically when you save the target document.
it doesn't works because I have an ~~tmpid.ide file (an ID file backup) in the $File field of the mail document so when I copy this doc I can't see anything in the destionation doc (the Body field doesn't exist in the source document)

Offline TMC

  • Freund des Hauses!
  • Gold Platin u.s.w. member:)
  • *****
  • Beiträge: 3.660
  • Geschlecht: Männlich
  • meden agan
Re:error when I try to copy an intern field
« Antwort #5 am: 11.06.04 - 15:47:17 »
I don't know what you mean with "~~tmpid.ide file".
But it seems to me that you work with encrypted email - documents?

If so, have a look at the following code:
http://www.atnotes.de/index.php?board=5;action=display;threadid=15495

The script decryptes email-documents (incl. richt text items).
« Letzte Änderung: 11.06.04 - 15:49:37 von TMC »
Matthias

A good programmer is someone who looks both ways before crossing a one-way street.


 

Impressum Atnotes.de  -  Powered by Syslords Solutions  -  Datenschutz