469,604 Members | 2,381 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,604 developers. It's quick & easy.

How to create and open Word document in Network PC with VB.NET


I created application that store the data in SQL SERVER that reside on
network. The client also use this application to access the resources
provided with application. But is the client want to register new customer or
companies they will enter the information in Windows Form and the program
automaticaly creates the WORD document under specific folder under
application path. Once the empty word file created than ask user if they want
to open it or not.

Everythings works fine under the application path. Now my boss ask me to
install the application another 3 computers. The problem is each client going
to get application path and if one of them trys to view any customer using
windows form they will not going to open a word document if the file is
created another user machine.

So I thought its a best way to achive this to create a shared folder that
has 2 partition only disk that also SQL Server reside.

Say example the the PC name is SQLSERVER2006000 and the has one hard drive
with 2 partition. C Drive and D Drive.

In the D Drive I created Shared Folder call MSCUSTDOCUMENT and this folder I
have another 2 folders as CUSTDOC and COMPDOC. With this each folder contains
word document that belong to either cutomer or companies. The word document
named after the customer ID such as cust00000008.doc under the CUSTDOC and
say comp00000004.doc under the COMPDOC folder.

My problem is that I can create empty word document (It copies empty
temp.doc into application path/CUSTDOC/ and rename it such as
cust00000008.doc) in every client machine and now I want to change the code
that every client can do the same but instead of using app path they will
have to access to network PC that I desribe in above. Unfortunetly I don't
know how to use VB.NET to achive network file copies (creation) and open.

Because once the document is created in the program View Customer client
have to view the cutomer information and they can use the btnOpen to open the
word document (it is in network PC) to view much detail information about the

Well I am sorry for my English but that what I am looking to achive:

Current File Copies into ApplicationPath ++++++++++++++++++++++++++++++
Dim pathName_TEMP_DOCUMENT As String =
Dim fullPath_TEMP_DOCUMENT As String

Path.GetFullPath(System.Windows.Forms.Application. StartupPath & "\..")

Dim pathName_NEW_DOCUMENT As String = "\MUSDOCUMENT\MUST\" & myNewDoc
Dim fullPath_NEW_DOCUMENT As String

Path.GetFullPath(System.Windows.Forms.Application. StartupPath & "\..")

File.Copy(fullPath_TEMP_DOCUMENT, fullPath_NEW_DOCUMENT, True)

'Check if the file created successfuly
Dim FileSystemObject1 As Object
FileSystemObject1 = CreateObject("Scripting.FileSystemObject")
If (FileSystemObject1.FileExists(fullPath_TEMP_DOCUME NT)) Then
fileCreated = True
fileCreated = False
End If
Now I want every client machine to use similar code to copy the Temp.doc
from network shared folder into appropriet destination agin in Netowrk shard

Then will ask user user if they want to open the Word Document. the word
document will open using windows forms that I coded before that has only Save
and exit menus.

The current word document opnes as:
Dim mShowCurrentCustomer As String = ""
mShowCurrentCustomer = Me.Text & " SHOWING THE MS WORD DOCUMENT for
CUSTOMER " & clsDataHolder._mMUSNO

Me.Text = mShowCurrentCustomer

'If the user does not cancel, open the document
If strFileName.Length Then
oDocument = Nothing
End If
I am sorry for long post but I try to ask very clearly what I am looking for
and I hope someone will help me to achive the things that I am looking for.

Thank you very much for reading my post.


Aug 11 '06 #1
0 2881

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Ronny Sigo | last post: by
3 posts views Thread by Andy Davis | last post: by
3 posts views Thread by Michael Tkachev | last post: by
3 posts views Thread by sloesch | last post: by
7 posts views Thread by Peter | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.