[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Create a copy of generated file

Posted on 2004-04-18
11
Medium Priority
?
189 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 1500 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

834 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