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 / December 2004

Tip: Looking for answers? Try searching our database.

Retrieving ProcessID of created Word object

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
MT - 13 Dec 2004 02:27 GMT
In the application that i am working on i have to use office to open up a
series of word documents and in turn print each of these documents to a
virtual printer to output the files to PDF format.  The problem is that
sometimes there may be an issue with the document that would stop the file
from opening e.g. corrupt template.

if using
dim objPDFWord As Microsoft.Office.Interop.Word.Application
objPDFWord = New Microsoft.Office.Interop.Word.Application

Is it possible to retrieve the process ID of the newly created word object?
The reason i need this is so if word fails to open a file and execution
doesnt return back to the current thread, we can use as final failsafe the
System.Diagnostics.Process methods to distroy that particular instance of
word.

Thanks in advance
liggett78 - 13 Dec 2004 13:53 GMT
I guess, Word should return some error HRESULT, if it is not able to open a
document (user UI can be turned off/silent to not display any popup message
boxes).

> In the application that i am working on i have to use office to open up a
> series of word documents and in turn print each of these documents to a
[quoted text clipped - 13 lines]
>
> Thanks in advance
MT - 16 Dec 2004 03:43 GMT
Are you refering to:
objPDFWord.DisplayAlerts = Word.WdAlertLevel.wdAlertsNone

If so i have found that it only works in some cases, in others cases it just
opens up word and waits for user input.  If not could you please point to me
which property i should be setting?

Thanks in advance,

Matthew

> I guess, Word should return some error HRESULT, if it is not able to open a
> document (user UI can be turned off/silent to not display any popup message
[quoted text clipped - 17 lines]
> >
> > Thanks in advance

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.