I am going nuts trying to get a very simple (??!!) CFSCRIPT to work. I would appreciate any ideas. I have gotten very detailed in what I have done to pinpoint the problem.
The following code works fine:
****BEGIN CODE SNIPPET*****
/* set a reference to the opened document*/
objDoc = objApp.ActiveDocument;
/* save as HTML */
objDoc.SaveAs("e:\inetpub\****END CODE SNIPPET*****
The file is saved with the new name. Therefore, I know that the SaveAs command will work.
The following code also works:
****BEGIN CODE SNIPPET*****
/* set a reference to the opened document*/
objDoc = objApp.ActiveDocument;
/*set a variable be used in the SaveAs command*/
saveName="e:\inetpub\
/* save as HTML */
objDoc.SaveAs(saveName);
****END CODE SNIPPET*****
Again, the file is saved with the new name. So I know that I can use a variable in the SaveAs command, without ## around it.
This code fails:
***BEGIN CODE SNIPPET****
/* set a reference to the opened document*/
objDoc = objApp.ActiveDocument;
/*set a variable be used in the SaveAs command*/
saveName="e:\inetpub\ WriteOutput("SaveName: #savename#"
;
/* save as HTML */
objDoc.SaveAs(saveName,10);
WriteOutput("Document Saved"
;
****END CODE SNIPPET****
The first WriteOutput works and outputs the correct name, but the second never runs, so I know that the error is occurring on the SaveAs line. I have tried using both single and double quotes around the 10. I have also tried setting a variable equal to 10 and using the variable. I tried using wdFormatHTML, but that generates "Error resolving parameter WDFORMATHTML".
I have confirmed, using VBA code and cycling through the FileConverters collection, that the HTML Converter on the server is SaveFormat=10.
The error is:
Error on Invoke for:
COM error 0x80020005. Type mismatch.
Does anyone have a fix/workaround/beer(it is New Years Eve, after all!)???
Thanks.
Kathryn
The following code works fine:
****BEGIN CODE SNIPPET*****
/* set a reference to the opened document*/
objDoc = objApp.ActiveDocument;
/* save as HTML */
objDoc.SaveAs("e:\inetpub\****END CODE SNIPPET*****
The file is saved with the new name. Therefore, I know that the SaveAs command will work.
The following code also works:
****BEGIN CODE SNIPPET*****
/* set a reference to the opened document*/
objDoc = objApp.ActiveDocument;
/*set a variable be used in the SaveAs command*/
saveName="e:\inetpub\
/* save as HTML */
objDoc.SaveAs(saveName);
****END CODE SNIPPET*****
Again, the file is saved with the new name. So I know that I can use a variable in the SaveAs command, without ## around it.
This code fails:
***BEGIN CODE SNIPPET****
/* set a reference to the opened document*/
objDoc = objApp.ActiveDocument;
/*set a variable be used in the SaveAs command*/
saveName="e:\inetpub\ WriteOutput("SaveName: #savename#"
/* save as HTML */
objDoc.SaveAs(saveName,10);
WriteOutput("Document Saved"
****END CODE SNIPPET****
The first WriteOutput works and outputs the correct name, but the second never runs, so I know that the error is occurring on the SaveAs line. I have tried using both single and double quotes around the 10. I have also tried setting a variable equal to 10 and using the variable. I tried using wdFormatHTML, but that generates "Error resolving parameter WDFORMATHTML".
I have confirmed, using VBA code and cycling through the FileConverters collection, that the HTML Converter on the server is SaveFormat=10.
The error is:
Error on Invoke for:
COM error 0x80020005. Type mismatch.
Does anyone have a fix/workaround/beer(it is New Years Eve, after all!)???
Thanks.
Kathryn