[Mono-list] MPP to MPD

Suneesh V.R suneeshvr at gmail.com
Thu Aug 2 02:54:42 EDT 2007


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20070802/185ee3a0/attachment.html 


More information about the Mono-list mailing list