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 / Languages / VB.NET / July 2007

Tip: Looking for answers? Try searching our database.

Running MS Word in VB.net with a switch

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dean Richardson - 26 Jul 2007 09:01 GMT
Hello,

We are currently running Word in a form OK. However, we need to run a
dedicated instance. In order to run this instance, as a service we use
the following code:

Dim p As New ProcessStartInfo("winword.exe", "/x")
Process.GetCurrentProcess().StartInfo = p

Currently to execute word in vb.net so that we can get a handle on it,
we use:

dim wrdapp as New Word.Application.

Is there a way to have wrdapp run the application with the /x switch
as we need to get a handle on the application to open documents within
this.

Thanks in Advance,
Dean
rowe_newsgroups - 26 Jul 2007 14:19 GMT
On Jul 26, 4:01 am, Dean Richardson <advertis...@deanrichardson.com>
wrote:
> Hello,
>
[quoted text clipped - 16 lines]
> Thanks in Advance,
> Dean

Forgive my ignorance, but what does the /x switch do? I don't know of
a way to use Office Interop with command line switches, but it might
be possible to recreate the functionality provided by /x.

Thanks,

Seth Rowe
Dean Richardson - 31 Jul 2007 13:43 GMT
> On Jul 26, 4:01 am, Dean Richardson <advertis...@deanrichardson.com>
> wrote:
[quoted text clipped - 29 lines]
>
> - Show quoted text -

Hi,

According to the MS KB article - it opens up a new instance of word
that only has one DDE request. The KB article can be found at:

http://support.microsoft.com/kb/210565

Thanks,
Dean
George Hardy - 26 Jul 2007 14:41 GMT
Here's how I am doing this:

Dim iPropNum As Integer
iPropNum = dgProposals.Item(dgProposals.CurrentRowIndex, 0)
'' Declare the variable.
Dim objWD As Word.Application
' Set the variable (runs new instance of Word.)
objWD = CreateObject("Word.Application")
' Add a new document.
objWD.Documents.Open(dgProposals.Item(dgProposals.CurrentRowIndex, 1))
'make visible for editing
objWD.Visible = True

hope this helps,
george hardy

----------------------------------------------------------
> Hello,
>
[quoted text clipped - 16 lines]
> Thanks in Advance,
> Dean

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.