By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,963 Members | 1,041 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,963 IT Pros & Developers. It's quick & easy.

Msword

P: n/a
Hi,
I have a doubt.
I have to open a predefined templet using VB.NET whenever
i apply a button click and at the same time i have to add
some data to the predefined templet using VB.NET i.e
handling the The word document through VB.NET code.
plz help me.
Regards,
krishna.
Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Krishna,

Please keep in the original thread, in this way answering you give the ones
who answer more work, because they don't know what was already answered.

Cor

"krishna murthy" <ve*************@gmail.com>
Hi,
I have a doubt.
I have to open a predefined templet using VB.NET whenever
i apply a button click and at the same time i have to add
some data to the predefined templet using VB.NET i.e
handling the The word document through VB.NET code.
plz help me.
Regards,
krishna.

Nov 21 '05 #2

P: n/a
Hi Krishna,

You can go through the following code snippet to see if it helps you

Public Function StartWord() As Word.Application
Dim wrdTmp As Word.Application
On Error Resume Next

Set wrdTmp = GetObject(, "Word.Application")
If Err.Number <> 0 Then
'Using New here would work just the
'same as using CreateObject, but I wanted
'it to be parallel for the other function.
Set wrdTmp = CreateObject("Word.Application")
End If
Set StartWord = wrdTmp
End Function

To use the function, write code like this (after you've set a reference to
Word in your application) in your button click event:

Dim wrdApp As Word.Application
Set wrdApp = StartWord()

HTH

Mona

"krishna murthy" <ve*************@gmail.com> wrote in message
news:22****************************@phx.gbl...
Hi,
I have a doubt.
I have to open a predefined templet using VB.NET whenever
i apply a button click and at the same time i have to add
some data to the predefined templet using VB.NET i.e
handling the The word document through VB.NET code.
plz help me.
Regards,
krishna.

Nov 21 '05 #3

P: n/a
"krishna murthy" <ve*************@gmail.com> schrieb:
I have to open a predefined templet using VB.NET whenever
i apply a button click and at the same time i have to add
some data to the predefined templet using VB.NET i.e
handling the The word document through VB.NET code.


For samples on automating Word using .NET programming languages, take a look
here:

<URL:http://support.microsoft.com/search/?qu=word+.NET>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.