467,925 Members | 1,833 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,925 developers. It's quick & easy.

late binding Word enumeration like WdSaveFormat.wdFormatWebArchive

Hi,

I have create Word object by late binding to open a Word document and
save it under another name. This new saved document should be saved as
mht-file. Following code I impelemented:

Parameters = new object[16];
Parameters[0] = "fileName.mht";
Parameters[1] = WdSaveFormat.wdFormatWebArchive;
Parameters[2] = false;
Parameters[3] = Missing.Value;
Parameters[4] = true;
Parameters[5] = Missing.Value;
Parameters[6] = false;
Parameters[7] = false;
Parameters[8] = false;
Parameters[9] = false;
Parameters[10] = false;
Parameters[11] = Missing.Value;
Parameters[12] = Missing.Value;
Parameters[13] = Missing.Value;
Parameters[14] = Missing.Value;
Parameters[15] = Missing.Value;
oDocCompare.GetType().InvokeMember("SaveAs", BindingFlags.InvokeMethod,
null, oDocCompare, Parameters);

At runtime there is an error by "Parameters[1] =
WdSaveFormat.wdFormatWebArchive;".
How can I implement this enumeration by late binding?

By early binding the code is followed and it works fine but I have to
implement this by late binding.

object compFile = "fileName.mht";
object fileFormat = Word.WdSaveFormat.wdFormatWebArchive;
object missing = Missing.Value;
object objTrue = true;
object objFalse = false;

compDoc.SaveAs(ref compFile, ref fileFormat, ref objFalse, ref missing,
ref objTrue, ref missing, ref objFalse, ref objFalse, ref objFalse, ref
objFalse, ref objFalse, ref missing, ref missing, ref missing, ref
missing, ref missing);
compDoc.ActiveWindow.View.Type = WdViewType.wdWebView;

Jan 19 '06 #1
  • viewed: 3313
Share:

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

21 posts views Thread by Mike MacSween | last post: by
9 posts views Thread by Zlatko Matiś | last post: by
2 posts views Thread by Mystery Man | last post: by
8 posts views Thread by scorpion53061 | last post: by
1 post views Thread by Robin Tucker | last post: by
reply views Thread by Steven Bolard | last post: by
10 posts views Thread by cj2 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.