473,570 Members | 2,865 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 SQLSERVER200600 0 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.do c under the CUSTDOC and
say comp00000004.do c 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.do c) 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_D OCUMENT As String =
"\MUSDOCUMENT\S DSTP_TEMPLATE\T emp.doc"
Dim fullPath_TEMP_D OCUMENT As String

fullPath_TEMP_D OCUMENT =
Path.GetFullPat h(System.Window s.Forms.Applica tion.StartupPat h & "\..")
fullPath_TEMP_D OCUMENT = fullPath_TEMP_D OCUMENT &
pathName_TEMP_D OCUMENT


'GET THE DESTINATION PATH
Dim pathName_NEW_DO CUMENT As String = "\MUSDOCUMENT\M UST\" & myNewDoc
Dim fullPath_NEW_DO CUMENT As String

fullPath_NEW_DO CUMENT =
Path.GetFullPat h(System.Window s.Forms.Applica tion.StartupPat h & "\..")
fullPath_NEW_DO CUMENT = fullPath_NEW_DO CUMENT & pathName_NEW_DO CUMENT


'COPY THE FILE
File.Copy(fullP ath_TEMP_DOCUME NT, fullPath_NEW_DO CUMENT, True)

'Check if the file created successfuly
Dim FileSystemObjec t1 As Object
FileSystemObjec t1 = CreateObject("S cripting.FileSy stemObject")
If (FileSystemObje ct1.FileExists( fullPath_TEMP_D OCUMENT)) 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 mShowCurrentCus tomer As String = ""
mShowCurrentCus tomer = Me.Text & " SHOWING THE MS WORD DOCUMENT for
CUSTOMER " & clsDataHolder._ mMUSNO

Me.Text = mShowCurrentCus tomer
Me.Refresh()

'If the user does not cancel, open the document
If strFileName.Len gth Then
oDocument = Nothing
AxWebBrowser1.N avigate2(strFil eName)
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 3215

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

Similar topics

0
1643
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 Word.Application Dim wrdDoc As Word.Document Dim strFileName As String
3
5802
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 in advance
3
2071
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 e-mail. So, how can I create a word-document if I have a html file? I created componet that allows do it. But this component doesn't work with...
2
13495
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 execute a MailMerge to create mailing labels or customized letters. A label name known to MS Word MailMerge mailing label wizard may be used or a...
3
12352
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? I would like to create a VB.net function that would do this, and I found this class *System.Web.UI.WebControls.HyperLink*, but I can not find...
0
2831
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 edit it, it opens the document but as a new one again. Fairly new to this so any help would be appreciated. Private Sub Command132_Click() ...
4
12423
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 this: can Access create the document and place it as an OLE object to the relevant table? Any help is greatly appreciated. Ricky
7
3996
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(); Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name);
0
2533
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 create a mailmerge routine that accepts data from my SQL database and create a word doc that ce be previewed in the client browser. My OS is XP Pro...
0
7636
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7948
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7700
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8000
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6329
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5247
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2131
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1238
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
971
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.