473,324 Members | 2,179 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,324 software developers and data experts.

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
0 3508

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

Similar topics

21
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: *********************************************************...
14
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...
9
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...
2
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. ...
8
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...
1
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...
0
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...
0
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...
10
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.