Solved

Create a copy of generated file

Posted on 2004-04-18
11
176 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
  • 7
  • 4
11 Comments
 
LVL 19

Expert Comment

by:RanjeetRain
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 19

Expert Comment

by:RanjeetRain
Comment Utility
macjacinto,

Have you tested the code?
0
 

Author Comment

by:macjacinto
Comment Utility
the error "File Not Found" appeared :(
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:macjacinto
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
I am sorry, I reckon I was a little too harsh. I apologize!
0
 
LVL 19

Expert Comment

by:RanjeetRain
Comment Utility
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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

762 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now