Secondly, VB isn't as bad a language as I expected. . .
Ok, here goes:
I'm the guy trying to automatically generate HTML files out of
Project 2000. I recorded a macro in Project, and I've been trying to
alter it to do general translations based upon a standard template
here's my effort at the macro, which I put in my GLOBAL.MPT under
Module3:
Sub HMacro3(Infile as String, Outfile as String)
' Macro HMacro3
' Macro Recorded Tue 7/17/01 by Harold Combs.
FileOpen Name:=Infile, ReadOnly:=False, FormatID:="MSProject.MPP"
FileSaveAs Name:=Outfile,_
FormatID:="MSProject.HTML", _
map:="Default task information"
End Sub
Ok, so far so good...now, Here's my VB6 routine, or at least the
germane bits:
Private Sub Command1_Click()
' Declare object variables for Microsoft Excel,
' application workbook, and worksheet objects.
Dim projApp As MSProject.Application
Dim strInputFile, strTargetFile, strMacroName As String
strTargetFile = "C:\out.html"
strMacroName = "Module3!HMacro3"
strInputFile = "Z:\foo\bar.mpp"
Set projApp = New MSProject.Application
projApp.Visible = False
projApp.Run strMacroName, strInputFile, strTargetFile
projApp.Quit
' Release the object.
Set projApp = Nothing
End Sub
Ok, so here's the record of my travails: I've done a projApp.Macro()
call, and that works fine, but since I can't pass it any parameters
it's useless.
Initially, I did it all in VBA using FileOpen() and FileSaveAs(), but
I coudldn't get any HTML out of it (closest the function offers is
pjTXT, a text file).
projApp.Run() seemed like the perfect solution, but it just refuses to
do anything. . .
I've looked-up some examples on the MS support site, but they're all
in Excel( http://support.microsoft.com/directory/article.asp?ID=kb;en-us;Q153307
) is there something different about Project that precludes the Run
method from working as advertised?
Many thanks
HRC
"Harold Combs" <hco...@hotmail.com> wrote in message
news:af14661d.01071...@posting.google.com...
Nevermind...I abandoned the Macro solution and went with pure VBA,
doing a FileOpen(), FileSaveAs() and FileClose(). Works like a charm
=-)
Now all I have to do is compile my function into a DLL, and call
it from a command-line C++ program. If anybody has any tips on this,
I'd appreciate it (I'm running VB5 SP5, and VC++ 6)
Harold
hco...@hotmail.com (Harold Combs) wrote in message news:<af14661d.01071...@posting.google.com>...