473,372 Members | 1,008 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,372 software developers and data experts.

late binding Word enumeration like WdSaveFormat.wdFormatWebArchive


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] =
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
0 3510

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Mike MacSween | last post by:
Had some trouble with Word automation. Sorted it, in the process thought I would try late binding. Some people reccomend it. So this: *********************************************************...
by: Composer | last post by:
I've read many postings about the problem of Access.References.IsBroken and the consensus seems to be that late binding is the cure-all. I have a very complex Access application that needs...
by: Zlatko Matić | last post by:
I was reading about late binding, but I'm not completely sure what is to be done in order to adjust code to late binding... For example, I'm not sure if this is correct: early binding: Dim ws...
by: Mystery Man | last post by:
We are developing a C# application that has many interfaces to the Microsoft suite (eg Word, Excel, Outlook, Powerpoint, etc). We need to support Office 97, 2000, 2002 and any future versions. ...
by: scorpion53061 | last post by:
I am sorry for this but I am not getting an answer elsewhere so I thought I would try here. It seems the safer way to go prior to deployment is to change my early binding to late binding to...
by: Robin Tucker | last post by:
I've run foul of this bug advisory from Microsoft: http://support.microsoft.com/default.aspx?scid=kb;en-us;292744 My preferred solution of the two listed is to use late binding. I have Option...
by: Steven Bolard | last post by:
Hello, I am trying to port my .net 1.1 application to 2.0. I am using vs2005. I am trying to get my webservices to run and although i can compile them and and get wsdl and service descriptions...
by: pmeems | last post by:
This is my first post to this group. So I say hello to all members. I'm in the process of converting my C# early binding of MS Word to late binding so I don't have any trouble running my...
by: cj2 | last post by:
I open a word template in VB and add values to the bookmarks then save the document as as pdf. When I then go to close the document it pops up a save as dialog box. It's already saved the...
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.