Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / November 2006

Tip: Looking for answers? Try searching our database.

problems with Word (COM)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Omega - 23 Nov 2006 21:18 GMT
Hello

I am using COM object (Word) in my application, and I have two problems:
1) I open new instance of Word, with empty, new document. I hendle the
event DocumentBeforeSave. I would like to do something like this on this
event:
-save active document, but without showing the Save As dialog (I can save
it using some generated filename) : I tried calling ActiveDocument.SaveAs
method, giving the filename, but it still shows the Save As dialog
-do something using the saved document
-end the event handling method and close word (or at least do something, so
that the next Save as dialog does not show up) - I tried setting SaveAsUI
to false, and Cancel to true, it doesn't help

2) I would like to refresh the form of a application after saving the
document, It doesn't work now, there's an exception on OnPaint event. I
know that Word is opened in new thread, maybe that's why I cant refresh
component on main form when handling BeforeSabe event

Can anyone help?
I work on Visual Studio 2005.

I'm sorry if this is simple question, I tried googling it, but i didn't
find anything usefull

Omega
Jigar Mehta - 24 Nov 2006 13:28 GMT
Hello,

I dont think this is right group for this question.

Interop means, if you are using some COM component from .NET - managed world,
you can post your question here. I think you should go to MS Office API newsgroup
for this issue.

=============
Regards,
Jigar Mehta

> Hello
>
[quoted text clipped - 26 lines]
>
> Omega
RobinS - 24 Nov 2006 16:59 GMT
Try the microsoft.public.vb.ole.automation group.

Robin S.
---------------------------
> Hello,
>
[quoted text clipped - 38 lines]
>>
>> Omega
Kodali Ranganadh - 25 Nov 2006 08:21 GMT
Hi, Omega

U can save the document with out open the save dialog box, in any of
the office automation applications, By simple calling the

this.ApplicationInstance.WordAppl.DisplayAlerts
=Microsoft.Office.Interop.Word.WdAlertLevel.wdAlertsNone;
Object xml = Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatXML;
applicationinstance.ActiveDocument.SaveAs(ref TemoFileName, ref xml,
ref Missing, ref Missing, ref Missing, ref  Missing, ref  Missing, ref
Missing, ref Missing, ref Missing, ref Missing, ref Missing, ref
Missing, ref Missing, ref Missing, ref Missing);

like that, Hear

and also same way u can open the empty document in any kind of
situation, Bys simple creating the instance like

Microsoft.Office.Interop.Word.Application app = new
Microsoft.Office.Interop.Word.ApplicationClass();
app.open();
like that.

> Hello
>
[quoted text clipped - 22 lines]
>
> Omega

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.