[Mono-list] MPP to MPD

Andy Hume andyhume32 at yahoo.co.uk
Thu Aug 2 05:05:09 EDT 2007


The code seems based around driving MSProject.Application.  So unless
you have some magic copy of Microsoft Project that runs on Linux, then
no it won't run on Linux. :-,)

(The use of the FSO could be converted to System.IO .File etc calls but
that's minor compared to the first).

Andy


________________________________

	From: mono-list-bounces at lists.ximian.com
[mailto:mono-list-bounces at lists.ximian.com] On Behalf Of Suneesh V.R
	Sent: 02 August 2007 07:55
	To: mono-list at lists.ximian.com
	Subject: [Mono-list] MPP to MPD
	
	
	Hi,
	 
	I would like to know the following code will work in linux using
Mono & .Net 
	 
	Sub Test()
	 Dim FSO
	 
	 Dim MSProjectApp
	 Dim INPath,OUTPath
	 
	 Const pjDoNotSave = 0
	 
	 INPath = Document.ConvertMPP.filename.value
	 OUTPath = Replace(INPath,".mpp",".mpd")
	 
	 'validate the IN and OUT parameters
	 If INPath = "" OR OUTPath = "" Then
	  ' error condition - does not require any action
	 Else
	  'Validate the Input file
	  Set FSO = CreateObject(" Scripting.FileSystemObject")
	 
	  If FSO.FileExists(INPath) Then
	   'convert the mpp to mpd
	   Set MSProjectApp = CreateObject("MSProject.Application")
	 
	   MSProjectApp.FileOpen(INPath)
	   MSProjectApp.FileSaveAs(OUTPath)
	   MSProjectApp.Application.FileCloseAll(pjDoNotSave)
	 
	   Set MSProjectApp = Nothing
	  End If
	 
	  If FSO.FileExists(OUTPath) Then
	   'FSO.DeleteFile(OUTPath)  ' commented,
	  End If
	 
	  Set FSO = Nothing
	 End If
	 
	End Sub
	 
	Thanks
	Suneesh




More information about the Mono-list mailing list