473,406 Members | 2,387 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

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

Hi,

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
customer.

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

Current File Copies into ApplicationPath ++++++++++++++++++++++++++++++
'GET THE TEMP DOCUMENT PATH
Dim pathName_TEMP_DOCUMENT As String =
"\MUSDOCUMENT\SDSTP_TEMPLATE\Temp.doc"
Dim fullPath_TEMP_DOCUMENT As String

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


'GET THE DESTINATION PATH
Dim pathName_NEW_DOCUMENT As String = "\MUSDOCUMENT\MUST\" & myNewDoc
Dim fullPath_NEW_DOCUMENT As String

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


'COPY THE FILE
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
Else
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
folder.

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:
strFileName = clsDOCLOCATION._mDOCUMENT
Dim mShowCurrentCustomer As String = ""
mShowCurrentCustomer = Me.Text & " SHOWING THE MS WORD DOCUMENT for
CUSTOMER " & clsDataHolder._mMUSNO

Me.Text = mShowCurrentCustomer
Me.Refresh()

'If the user does not cancel, open the document
If strFileName.Length Then
oDocument = Nothing
AxWebBrowser1.Navigate2(strFileName)
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.

Rgds,
GC

Aug 11 '06 #1
0 3182

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ronny Sigo | last post by:
Hello all, In my application I have to open a predefined MS Word document. I do this with the following code: Dim sDatum As String sDatum = Date Dim sNaamschrijver As String Dim appWord As...
3
by: Andy Davis | last post by:
How do i or can I open a word document directly from Access? I would like to be able for the user to click a button on my form to open a word document and then also run a macro in Word. Thanks...
3
by: Michael Tkachev | last post by:
Hi Everybody! I have a problem. When I get a HTML of my page that I'm rendering. I need to generate a word-document from a html. And than I have to send this word-document to the users through...
2
by: Mikey | last post by:
Sample VB .NET source code to create mailing labels or customized letters using MS Word MailMerge This VB .NET source code will start MS Word and call methods and set properties in MS Word to...
3
by: sloesch | last post by:
I am working with VS.net 2003, framework 1.1, developing with VB.net, and ASP.net, and I would like to know how you can create a dynamic hyperlink on the fly to a document stored in a SQL database?...
0
by: jayne | last post by:
I have created the following code the first part works to create a word document with but when I have created the document and existed word, I then click the button again to open up the document to...
4
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is...
7
by: Peter | last post by:
ASP.NET 2.0 I am trying to open a Word document and Excel document from a dialog web page, what's the best way to do that? I have tried the following: Response.Clear();...
0
by: dbsog7777 | last post by:
I was trying to use the sample code below, but I encountered two errors: Application.DoEvents() and AutoText(entry). I am not sure how to correct the errors. I trying to use the sample code to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.