Interop.MSProject FileSaveAs [英] Interop.MSProject FileSaveAs

查看:69
本文介绍了Interop.MSProject FileSaveAs的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在尝试编写VB.Net代码来控制MSProject 2003时,建议我在MSProject中记录一个宏并将代码传输到VB.Net。

。当

记录FileSaveAs(到项目服务器)时,我得到以下内容:


FileSaveAs(名称:="<> \ MyProject。已发布",UserID:="",DatabasePassWord:="",

FormatID:="")


但是,这个给了我有用的错误消息意外错误

与该方法一起发生。当应用于我的应用程序时,以下

的方式:


Dim prj As New Microsoft.Office.Interop.MSProject.Application

使用prj

.FileOpen(" c:\ prjTemplate.mpp")

.ActiveProject.Name =" DOG"

.ActiveProject.Comments =" CAT"

.FileSaveAs(Name:="<> \ MyProject.Published",UserID:="",

DatabasePassWord:="",FormatID:="")

.FileClose()

结束


任何帮助都将不胜感激。


-

stullhe104

解决方案

你好stullhe104


由于缺少凭据信息,会发生错误。当您记录

宏时,Project不会记录

安全性的用户ID和密码信息。因此,您会看到UserID和DatabasePassWord参数

be"在代码中。我们需要手动指定它们的值。


此外,您需要确保您的项目无法工作

离线,并且用户已记录有权获得适当的许可。否则,

错误消息您没有足够的权限将新项目添加到

Project Server会弹出来的。项目允许我们在启动时选择账户




问候,

贾良戈(ji ****) @ online.microsoft.com,删除''在线。'')

Microsoft在线社区支持


=========== ======================================

让客户满意是我们的第一优先事项。我们欢迎您的意见和

有关我们如何改进我们为您提供的支持的建议。请

随时让我的经理知道您对服务水平的看法

提供。您可以直接向我的经理发送反馈:
ms****@microsoft.com


此帖子按原样提供。没有保证,也没有授予任何权利。

================================= ================

" Herb" < st ******** @ newsgroup.nospamwrote in message

news:08 ********************** ************ @ microsof t.com ...


在尝试编写VB.Net代码来控制MSProject 2003时,它是

推荐

我在MSProject中记录一个宏并将代码传输到VB.Net。当

记录FileSaveAs(到项目服务器)时,我得到以下内容:


FileSaveAs(名称:="<> \ MyProject。已发布",UserID:="",

DatabasePassWord:="",

FormatID:="")

>
但是,这给了我有用的信息。错误消息意外错误

与该方法一起发生。当应用于我的应用程序时,以下

的方式:


Dim prj As New Microsoft.Office.Interop.MSProject.Application

使用prj

.FileOpen(" c:\ prjTemplate.mpp")

.ActiveProject.Name =" DOG"

.ActiveProject.Comments =" CAT"

.FileSaveAs(Name:="<> \ MyProject.Published",UserID:="",

DatabasePassWord:="",FormatID:="")

.FileClose()

结束


任何帮助将不胜感激。


-

stullhe104



感谢您的回复。当我提供我的Windows Auth用户ID和密码时我将获得相同的错误。


.FileSaveAs(名称:="<> \ MyProject .Published",UserID:=" DOMAIN\USERID",

DatabasePassWord:=" mypasword",FormatID:="")


-

stullhe104

Jialiang Ge [MSFT]"写道:


Hello stullhe104


由于缺少凭证信息,会发生错误。当您记录

宏时,Project不会记录

安全性的用户ID和密码信息。因此,您会看到UserID和DatabasePassWord参数

be"在代码中。我们需要手动指定它们的值。


此外,您需要确保您的项目无法工作

离线,并且用户已记录有权获得适当的许可。否则,

错误消息您没有足够的权限将新项目添加到

Project Server会弹出来的。项目允许我们在启动时选择账户




问候,

贾良戈(ji ****) @ online.microsoft.com,删除''在线。'')

Microsoft在线社区支持


=========== ======================================

让客户满意是我们的第一优先事项。我们欢迎您的意见和

有关我们如何改进我们为您提供的支持的建议。请

随时让我的经理知道您对服务水平的看法

提供。您可以直接向我的经理发送反馈:
ms****@microsoft.com


此帖子按原样提供。没有保证,也没有授予任何权利。

================================= ================


" Herb" < st ******** @ newsgroup.nospamwrote in message

news:08 ********************** ************ @ microsof t.com ...


在尝试编写VB.Net代码来控制MSProject 2003时,它是

推荐

我在MSProject中记录一个宏并将代码传输到VB.Net。当

记录FileSaveAs(到项目服务器)时,我得到以下内容:


FileSaveAs(名称:="<> \ MyProject。已发布",UserID:="",

DatabasePassWord:="",

FormatID:="")

>
但是,这给了我有用的信息。错误消息意外错误

与该方法一起发生。当应用于我的应用程序时,以下

的方式:


Dim prj As New Microsoft.Office.Interop.MSProject.Application

使用prj

.FileOpen(" c:\ prjTemplate.mpp")

.ActiveProject.Name =" DOG"

.ActiveProject.Comments =" CAT"

.FileSaveAs(Name:="<> \ MyProject.Published",UserID:="",

DatabasePassWord:="",FormatID:="")

.FileClose()

结束


任何帮助将不胜感激。


-

stullhe104



你好stullhe104,


这次错误是由MSProject实例的可能性造成的$ b正在脱机工作(请参阅我上次回复中的第二点)。我的同事Ji

Zhou [MSFT]和我正在寻找自动化

项目的可能解决方案来连接到Project服务器。我们会尽快给你回复

.


问候,

贾良戈(ji **** @ online.microsoft.com,删除''在线。'')

Microsoft在线社区支持


============ =====================================

让我们的客户满意是我们的#1优先级。我们欢迎您的意见和

有关我们如何改进我们为您提供的支持的建议。请

随时让我的经理知道您对服务水平的看法

提供。您可以直接向我的经理发送反馈:
ms****@microsoft.com


此帖子按原样提供。没有保证,也没有授予任何权利。

================================= ================

" Herb" < st ******** @ newsgroup.nospamwrote in message

news:1E ********************** ************ @ microsof t.com ...


感谢您的回复。当我提供我的Windows Auth用户ID和密码时我将获得相同的错误。


.FileSaveAs(名称:="<> \ MyProject .Published",UserID:=" DOMAIN\USERID",

DatabasePassWord:=" mypasword",FormatID:="")


-

stullhe104


Jialiang Ge [MSFT]"写道:


> Hello stullhe104

错误发生在缺少凭证信息的情况下。当您录制
宏时,Project不会为安全起见记录用户ID和密码信息。因此,您会看到UserID和DatabasePassWord
参数是"在代码中。我们需要手动指定它们的值。

此外,您需要确保您的项目无法正常工作,并且登录的用户具有适当的权限。否则,
错误消息您没有足够的权限将新项目添加到项目服务器。会弹出来的。项目允许我们在启动时选择
帐户。

问候,
Jialiang Ge(ji****@online.microsoft.com,删除''在线。'')
微软在线社区支持

=========================== ==================== ==
让客户满意是我们的首要任务。我们欢迎您的意见和建议,以便我们如何改进我们为您提供的支持。
请随时让我的经理知道您对服务水平的看法
提供。您可以直接向我的经理发送反馈:
ms****@microsoft.com

此帖子按原样提供。没有保证,也没有赋予
权利。
================================= ============== ==

" Herb" < st ******** @ newsgroup.nospamwrote in message
新闻:08 ************************** ******** @ microso ft.com ...


在尝试编写VB.Net代码来控制MSProject 2003时它是

推荐

我在MSProject中记录一个宏并将代码传输到VB.Net。



记录FileSaveAs(到项目服务器)我得到以下内容:


FileSaveAs(名称:="<> \ MyProject.Published",UserID:="",

DatabasePassWord:="",

FormatID:="")


但是,这给了我有用"错误消息意外错误

与该方法一起发生。

后应用于我的应用程序

方式:


Dim prj As New Microsoft.Office.Interop.MSProject。申请


使用prj

.FileOpen(" c:\ prjTemplate.mpp")

.ActiveProject.Name = DOG

.ActiveProject.Comments =" CAT"

.FileSaveAs(Name:="<> \ MyProject.Published",UserID: ="",

DatabasePassWord:="",FormatID:="")

.FileClose()

结束


任何帮助将不胜感激。


-

stullhe104




In trying to write VB.Net code to control MSProject 2003 it was recommended
that I record a macro in MSProject and transfer the code to VB.Net. When
recording the FileSaveAs (to the project server) I get the following:

FileSaveAs(Name:="<>\MyProject.Published", UserID:="", DatabasePassWord:="",
FormatID:="")

However, this gives me the "useful" error message "An unexpected error
occurred with the method." when applied to my application in the following
way:

Dim prj As New Microsoft.Office.Interop.MSProject.Application

With prj
.FileOpen("c:\prjTemplate.mpp")
.ActiveProject.Name = "DOG"
.ActiveProject.Comments = "CAT"
.FileSaveAs(Name:="<>\MyProject.Published", UserID:="",
DatabasePassWord:="", FormatID:="")
.FileClose()
End With

Any help would be appreciated.

--
stullhe104

解决方案

Hello stullhe104

The error happens for lack of the credential information. When you record
macros, Project does not record the user id and password information for
sake of security. Thus, you see the UserID and DatabasePassWord parameters
be "" in the code. We would need to manually specify their values.

In addition, you would need to make sure that your Project is not working
offline, and the user logged on has the proper permission. Otherwise, an
error message "You do not have sufficient permissions to add new projects to
Project Server" will be popped up. Project allows us to choose the account
when it starts up.

Regards,
Jialiang Ge (ji****@online.microsoft.com, remove ''online.'')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
"Herb" <st********@newsgroup.nospamwrote in message
news:08**********************************@microsof t.com...

In trying to write VB.Net code to control MSProject 2003 it was
recommended
that I record a macro in MSProject and transfer the code to VB.Net. When
recording the FileSaveAs (to the project server) I get the following:

FileSaveAs(Name:="<>\MyProject.Published", UserID:="",
DatabasePassWord:="",
FormatID:="")

However, this gives me the "useful" error message "An unexpected error
occurred with the method." when applied to my application in the following
way:

Dim prj As New Microsoft.Office.Interop.MSProject.Application

With prj
.FileOpen("c:\prjTemplate.mpp")
.ActiveProject.Name = "DOG"
.ActiveProject.Comments = "CAT"
.FileSaveAs(Name:="<>\MyProject.Published", UserID:="",
DatabasePassWord:="", FormatID:="")
.FileClose()
End With

Any help would be appreciated.

--
stullhe104



Thanks for the reply. When I provide my Windows Auth userid and password I
get the same error.

.FileSaveAs(Name:="<>\MyProject.Published", UserID:="DOMAIN\USERID",
DatabasePassWord:="mypasword", FormatID:="")

--
stullhe104
"Jialiang Ge [MSFT]" wrote:

Hello stullhe104

The error happens for lack of the credential information. When you record
macros, Project does not record the user id and password information for
sake of security. Thus, you see the UserID and DatabasePassWord parameters
be "" in the code. We would need to manually specify their values.

In addition, you would need to make sure that your Project is not working
offline, and the user logged on has the proper permission. Otherwise, an
error message "You do not have sufficient permissions to add new projects to
Project Server" will be popped up. Project allows us to choose the account
when it starts up.

Regards,
Jialiang Ge (ji****@online.microsoft.com, remove ''online.'')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
"Herb" <st********@newsgroup.nospamwrote in message
news:08**********************************@microsof t.com...

In trying to write VB.Net code to control MSProject 2003 it was
recommended
that I record a macro in MSProject and transfer the code to VB.Net. When
recording the FileSaveAs (to the project server) I get the following:

FileSaveAs(Name:="<>\MyProject.Published", UserID:="",
DatabasePassWord:="",
FormatID:="")

However, this gives me the "useful" error message "An unexpected error
occurred with the method." when applied to my application in the following
way:

Dim prj As New Microsoft.Office.Interop.MSProject.Application

With prj
.FileOpen("c:\prjTemplate.mpp")
.ActiveProject.Name = "DOG"
.ActiveProject.Comments = "CAT"
.FileSaveAs(Name:="<>\MyProject.Published", UserID:="",
DatabasePassWord:="", FormatID:="")
.FileClose()
End With

Any help would be appreciated.

--
stullhe104




Hello stullhe104,

The error this time is caused by the possibility that the MSProject instance
is working offline (see the second point in my last reply). My colleague Ji
Zhou [MSFT] and I are searching for the possible solutions of automating
Project to connect to the Project server. We will get back to you as soon as
possible.

Regards,
Jialiang Ge (ji****@online.microsoft.com, remove ''online.'')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
"Herb" <st********@newsgroup.nospamwrote in message
news:1E**********************************@microsof t.com...

Thanks for the reply. When I provide my Windows Auth userid and password I
get the same error.

.FileSaveAs(Name:="<>\MyProject.Published", UserID:="DOMAIN\USERID",
DatabasePassWord:="mypasword", FormatID:="")

--
stullhe104
"Jialiang Ge [MSFT]" wrote:

>Hello stullhe104

The error happens for lack of the credential information. When you record
macros, Project does not record the user id and password information for
sake of security. Thus, you see the UserID and DatabasePassWord
parameters
be "" in the code. We would need to manually specify their values.

In addition, you would need to make sure that your Project is not working
offline, and the user logged on has the proper permission. Otherwise, an
error message "You do not have sufficient permissions to add new projects
to
Project Server" will be popped up. Project allows us to choose the
account
when it starts up.

Regards,
Jialiang Ge (ji****@online.microsoft.com, remove ''online.'')
Microsoft Online Community Support

=============================================== ==
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you.
Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no
rights.
=============================================== ==
"Herb" <st********@newsgroup.nospamwrote in message
news:08**********************************@microso ft.com...

In trying to write VB.Net code to control MSProject 2003 it was
recommended
that I record a macro in MSProject and transfer the code to VB.Net.
When
recording the FileSaveAs (to the project server) I get the following:

FileSaveAs(Name:="<>\MyProject.Published", UserID:="",
DatabasePassWord:="",
FormatID:="")

However, this gives me the "useful" error message "An unexpected error
occurred with the method." when applied to my application in the
following
way:

Dim prj As New Microsoft.Office.Interop.MSProject.Application

With prj
.FileOpen("c:\prjTemplate.mpp")
.ActiveProject.Name = "DOG"
.ActiveProject.Comments = "CAT"
.FileSaveAs(Name:="<>\MyProject.Published", UserID:="",
DatabasePassWord:="", FormatID:="")
.FileClose()
End With

Any help would be appreciated.

--
stullhe104





这篇关于Interop.MSProject FileSaveAs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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