要求将MPP文件的副本保存到存档 [英] Requirement to Save Copy of MPP File to Archive

查看:124
本文介绍了要求将MPP文件的副本保存到存档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

(MSP 2007和2010,30位用户,没有Project Server)

(MSP 2007 and 2010, 30 users, no Project Server)

我有一个要求捕获版本控制的文档存储库中的计划的快照。我有一个有效的解决方案,但似乎有点不优雅,我想知道是否有更简洁的方法来做到这一点。

I've got a requirement to capture snapshots of the schedule in a version controlled document repository. I've got a solution which works but it seems a bit inelegant, and I wondered if there was a neater way of doing this.

我在ProjectAfterSave上添加了一个子程序将SaveAs放入存档,然后将另一个SaveAs返回到原始位置的事件,以便将project.path设置回其原始值(因此用户不会开始处理存档
副本)。执行SaveAs两次似乎有点矫枉过正,并且会将节省时间增加50%,这对于大型项目来说可能非常明显。

I've added a sub-procedure on the ProjectAfterSave event which does a SaveAs into the archive, then another SaveAs back to the original location, in order to set the project.path back to its original value (so the users doesn't start working on the archive copy). Doing the SaveAs twice seems to be overkill, and will increase the save time by 50%, which could be quite noticeable for larger projects.

有没有更优雅的方式来做到这一点,例如as:

Is there a more elegant way of doing this, such as:


  1. 与以前在Excel中的SaveCopyAs方法相同?
  2. 将project.path更改回以前的方法第一个SaveAs之后的值?


Sub SaveArchiveCopytoRMA()

    Dim pj As Project
    Dim MPP_Original As String
    Dim MPP_Archive As String
    
    Set pj = ActiveProject
    
    'Capture the original location
    MPP_Original = pj.Path + "\" + pj.Name
    
    'Set the target location for the archive
    MPP_Archive = "############" + "\" + pj.Name
    
    'First save to the archive
    pj.SaveAs (MPP_Archive)
    
    'Then save back to the original location
    pj.SaveAs (MPP_Original)

End Sub




推荐答案

你需要一个吗?复制每次保存?为什么不使用Before_Close事件?
Do you need a copy with every save? Why not use the Before_Close event?


这篇关于要求将MPP文件的副本保存到存档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆