Solved

Create a copy of generated file

Posted on 2004-04-18
11
184 Views
Last Modified: 2013-12-18
i generated a csv file and attached it to a document at run time, my problem now is, how can i make copy of the same file in a folder in my hard disk drive, also at run time? so the process would be, i generate the file, attach the file to a document then save it in one of my hdd folders....hoping for a prompt reply! tnx!!
0
Comment
Question by:macjacinto
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 4
11 Comments
 
LVL 19

Expert Comment

by:RanjeetRain
ID: 10857235
Depends on how you egenrated the file. I'd suggest add the code to save it at the same place where you have generated it. Also, post your code that you are using to generate the file.

You can also use @Command( [EditDetach] ; sourcefile ; targetfile ) if thjat is the only atytachment in your document.
0
 

Author Comment

by:macjacinto
ID: 10857491
here's the code i used in attaching the file to the document

      'Create report document
      Set docReport = New notesDocument(db)
      docReport.Form = "amla"
      docReport. FormName = "amla"
      docReport.AgentStatus = "0"
      docReport.Flag = "No"
      docReport.SendTo = "amla"
      docReport.dcol = Format(doc.transtag (0), "mm/dd/yyyy")
      docReport.brname = doc2.profile(0)
      docReport.by =by$
      Set rtitem = New NotesRichTextItem(docReport, "txt")
      Set object = rtitem.EmbedObject ( EMBED_ATTACHMENT, "", strFileName)      
      Call docReport.ComputeWithForm(False,False)
      Call docReport.Save(True,False)      
      Call w.viewRefresh
      Close fileNum%
      Kill strFileName
      Messagebox("Done Generating CSV File")
      Exit Sub
      End If

if i use the @command u gave, what sourcefile will i indicate? since i generated the file at runtime?
0
 
LVL 19

Accepted Solution

by:
RanjeetRain earned 500 total points
ID: 10857626
You have everything you need!

    Set docReport = New notesDocument(db)
    docReport.Form = "amla"
    docReport. FormName = "amla"
    docReport.AgentStatus = "0"
    docReport.Flag = "No"
    docReport.SendTo = "amla"
    docReport.dcol = Format(doc.transtag (0), "mm/dd/yyyy")
    docReport.brname = doc2.profile(0)
    docReport.by =by$
    Set rtitem = New NotesRichTextItem(docReport, "txt")
    Set object = rtitem.EmbedObject ( EMBED_ATTACHMENT, "", strFileName)    
    Call docReport.ComputeWithForm(False,False)
    Call docReport.Save(True,False)    
    Call w.viewRefresh
    Close fileNum%

    '''''''''''''''''''''''''''' Code added by Ranjeet Rain
    Dim strPath as string
    strPath = "C:\\Temp\\"
    FileCopy strFileName, strPath & strFileName
    '''''''''''''''''''''''''''' End code added by Ranjeet Rain

    Kill strFileName
    Messagebox("Done Generating CSV File")
    Exit Sub
    End If



Change the value of strPath as per your needs.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 19

Expert Comment

by:RanjeetRain
ID: 10868181
macjacinto,

Have you tested the code?
0
 

Author Comment

by:macjacinto
ID: 10885255
the error "File Not Found" appeared :(
0
 

Author Comment

by:macjacinto
ID: 10885302
ranjeet...i found the prob :) i didnt used the code you gave but just deleted the Kill strFileName line and it worked out perfectly
0
 
LVL 19

Expert Comment

by:RanjeetRain
ID: 10885582
I just checked your profile. And Your question history too. Here is what I saw.

Questions Asked: 34
Questions Open: 4         <---
Questions Graded: 13
Questions Deleted: 17    <---
Last 10 Grades Given: A A A B A A A A A A

I also checked some of your threads. I now understand why no one responded to such a simple question even after hours of it was posted in a TA where people recv answers within minutes.

My answer was to-the-point and it solved your problem in a pretty neat way. You must close this question with an A, unlike you have done in many of your previous threads.
0
 
LVL 19

Expert Comment

by:RanjeetRain
ID: 10885584
By the way, your deleting the KILL statement doesn't serve a purpose in the scenario. You can't use that as a pretext to keep this thread open or ask for a refund.
0
 

Author Comment

by:macjacinto
ID: 10897488
I dont think i need to explain to you why i havent closed my open questions yet, as for the deleted questions, you may want to check each of them to see if i got any solutions for the problem i posted. Dont you yourself deleted questions and you also have open questions as of date?! And we have different reasons of doing so, so dont go accussing me of anything. I merely informed you of what I did and that was your reaction?! Gee
0
 
LVL 19

Expert Comment

by:RanjeetRain
ID: 10897653
I am sorry, I reckon I was a little too harsh. I apologize!
0
 
LVL 19

Expert Comment

by:RanjeetRain
ID: 10897663
Also, I want to thank you specially, since your accepting this question has taken me past my 100K here :D

Thanks again!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question