473,385 Members | 1,445 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Passing prameters

Hi,
I want to convert a microsoft project file into xml file.. Below is
the code :

<%
Dim a
Set a= Server.CreateObject("MSProject.Application")

Dim objFSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(Server.MapPath("1.xml")) Then
objFSO.DeleteFile Server.MapPath("1.xml")
End IF
a.FileOpen Server.MapPath ("1.mpp")
a.FileSaveAs Server.MapPath ("1.xml")
'a.FileCloseAll
Response.write "...Success ...009"
%>

I am creating the application object and asking it to save as XML. I need to
specify the FormatID inthe filesaveas parameter. But how to do that. In VBA ,
we do like
FileSave As Name:="1.xm;",FormatID:="MSProject.XML" .... I need to pass
this parameter to get it done. How to do that.

Presently this is writing a 1.xml file but that is not in the XML format. I
suspect the file is written in the MPP format. Plz help...
Jul 22 '05 #1
1 1203
1. You're creating a server-side instance of Project which is a highly
ill-advised thing to do.
2. If ignoring #1, try:

a.SaveAs Server.MapPath("1.xml"), , , , , , , , , "MSProject.XML"

Ray at work

"Kishore" <Ki*****@discussions.microsoft.com> wrote in message
news:72**********************************@microsof t.com...
Hi,
I want to convert a microsoft project file into xml file.. Below is the code :

<%
Dim a
Set a= Server.CreateObject("MSProject.Application")

Dim objFSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(Server.MapPath("1.xml")) Then
objFSO.DeleteFile Server.MapPath("1.xml")
End IF
a.FileOpen Server.MapPath ("1.mpp")
a.FileSaveAs Server.MapPath ("1.xml")
'a.FileCloseAll
Response.write "...Success ...009"
%>

I am creating the application object and asking it to save as XML. I need to specify the FormatID inthe filesaveas parameter. But how to do that. In VBA , we do like
FileSave As Name:="1.xm;",FormatID:="MSProject.XML" .... I need to pass
this parameter to get it done. How to do that.

Presently this is writing a 1.xml file but that is not in the XML format. I suspect the file is written in the MPP format. Plz help...

Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Dave | last post by:
I'm currently working on a small project (admitedly for my CS class) that compares the time difference between passing by value and passing by reference. I'm passing an array of 50000 int's. ...
58
by: jr | last post by:
Sorry for this very dumb question, but I've clearly got a long way to go! Can someone please help me pass an array into a function. Here's a starting point. void TheMainFunc() { // Body of...
9
by: Just Me | last post by:
PARAFORMAT2 is a structure that SendMessage will return stuff in. Is the "ref" correct or since only a pointer is being passed should it be by value? Suppose I was passing data rather then...
8
by: Dennis Myrén | last post by:
I have these tiny classes, implementing an interface through which their method Render ( CosWriter writer ) ; is called. Given a specific context, there are potentially a lot of such objects,...
22
by: Arne | last post by:
How do I pass a dataset to a webservices? I need to submit a shoppingcart from a pocket PC to a webservice. What is the right datatype? II have tried dataset as a datatype, but I can't get it to...
6
by: MSDNAndi | last post by:
Hi, I get the following warning: "Possibly incorrect assignment to local 'oLockObject' which is the argument to a using or lock statement. The Dispose call or unlocking will happen on the...
12
by: Andrew Bullock | last post by:
Hi, I have two classes, A and B, B takes an A as an argument in its constructor: A a1 = new A(); B b = new B(a1);
12
by: Mike | last post by:
Consider the following code: """ struct person { char *name; int age; }; typedef struct person* StructType;
7
by: TS | last post by:
I was under the assumption that if you pass an object as a param to a method and inside that method this object is changed, the object will stay changed when returned from the method because the...
4
by: Deckarep | last post by:
Hello fellow C# programmers, This question is more about general practice and convention so here goes: I got into a discussion with a co-worker who insisted that as a general practice all...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.