6 Replies Latest reply on Dec 3, 2008 12:20 PM by Christina Seay

    GetFileCopy method...

    Christina Seay
      I am trying to retrieve a copy of a file to my local cache and I'm using GetFileCopy to do it.

      When my program tries to access the excel file, it can't find it.

      Can anyone tell me if there is something wrong with my code:

       

      Dim GetExcel As IEdmFile5 Dim ExcelFolder As IEdmFolder5 ExcelFolder = vault.GetFolderFromPath(vault.RootFolderPath + "\_Administrator Files\") GetExcel = ExcelFolder.GetFile("ITEM.XLS") GetExcel.GetFileCopy(Me.Handle.ToInt32, 0, ExcelFolder.ID, EdmGetFlag.EdmGet_Simple, "")

      I'm not sure if I'm getting the code wrong, or getting something else wrong. I've got this code on the "form_load" part of the program. So it should be copying it down to the local cache as soon as the form loads.

      This program runs fine after the user checks the file out and checks it back in, so it seems like it's an issue with it not being in the local cache.
        • GetFileCopy method...
          Christina Seay
          Ok... that got all jumbled up... here it is a bit clearer

          Dim GetExcel As IEdmFile5
          Dim ExcelFolder As IEdmFolder5

          ExcelFolder = vault.GetFolderFromPath(vault.RootFolderPath + "\_Administrator Files\")
          GetExcel = ExcelFolder.GetFile("ITEM.XLS")
          GetExcel.GetFileCopy(Me.Handle.ToInt32, 0, ExcelFolder.ID, EdmGetFlag.EdmGet_Simple, "")
          • GetFileCopy method...
            How do you know it can't find it? Your code looks fine, but I don't see any error checking which is why I am asking.
            • GetFileCopy method...
              Christina Seay
              It pops up a message when I click the button on the form that accesses the excel sheet that says that it can't find it. But when I go in and check out the file and then check it back in and then go back to my form and click the button again, it works fine. So that line has to have something wrong with it... but I have no idea what....
              • GetFileCopy method...
                Christina Seay
                Nope.. that didn't fix it.. hmmmm...
                • GetFileCopy method...
                  Christina Seay
                  OMGosh!!! I finally fixed it... you're never going to believe what it was... good grief!

                  This works:

                  Dim GetExcel As IEdmFile5
                  Dim ExcelFolder As IEdmFolder5

                  ExcelFolder = vault.GetFolderFromPath(vault.RootFolderPath + "\_Administrator Files")
                  GetExcel = ExcelFolder.GetFile("ITEM.XLS")
                  GetExcel.GetFileCopy(Me.Handle.ToInt32, 0, ExcelFolder.ID, EdmGetFlag.EdmGet_Simple, "")

                  The ONLY difference... I had a "\" at the end of "\_Administrator Files\" and that was breaking the file name!! Thanks for your help Lee... knowing that I hadn't fundamentally screwed up the code helped me figured it out!