Solved

Create a copy of generated file

Posted on 2004-04-18
11
179 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
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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

816 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

8 Experts available now in Live!

Get 1:1 Help Now