I want to create a word document that can be editable . Also I want to add some text to word document from database. Please let me know the useful link for this. Also if there is any free editor and compiler for VB to download.
I want to create a word document that can be editable . Also I want to add some text to word document from database. Please let me know the useful link for this. Also if there is any free editor and compiler for VB to download.
Thanks in advance
Nike
Welcome to the forums.
To open a word document, set a reference to the Microsoft Word Object Library. Then use something like
VB Code:
Dim oWord As Word.Application
Dim oDoc As Word.Document
' This procedure demonstrates using the Execute
' method to replace text.
Set oWord = GetObject(, "Word.Application")
If oWord Is Nothing Then
Set oWord = CreateObject("Word.Application")
End If
oWord.Documents.Open FileName:="c:\test.doc"
oWord.Documents("test.doc").Activate
Set oDoc = oWord.ActiveDocument
.frm forms are fundamentally text files, so you can actually open them with Notepad. There is only one VB6 compiler, and it comes with VB6, and is not free.
Thanks for help. Actually I am coldfusion programmer But I have to create a rtf document that is supported by VB. If you can send me link or describe me how can I use the editor to run this code .
Thanks for help. Actually I am coldfusion programmer But I have to create a rtf document that is supported by VB. If you can send me link or describe me how can I use the editor to run this code . I am using Microsoft VB6.0
Thanks for help. Actually I am coldfusion programmer But I have to create a rtf document that is supported by VB. If you can send me link or describe me how can I use the editor to run this code . I am using Microsoft VB6.0
I am using Microsoft Visual studio and version is Visual Basic 6.0 . Actually when I open the IDE there were alot of options. I was not sure which one I have to pick.
I am using Microsoft Visual studio and version is Visual Basic 6.0 . Actually when I open the IDE there were alot of options. I was not sure which one I have to pick.
Thanks
Nike
Ok, gotcha.
Step 1. Click Project/References
Find Microsoft Word Object Library
Click the checkbox next to it.
Click OK.
Now you have the proper reference to use Word in your VB program.
The code to open a Word document that I orginally posted should work now.
what does user type not defined means. if you dnt mind do u have any contact numebr. I will give u call at your suitable time to get the things set to go.
Thanks
Nike
It says Compiler Error. Invalied Outside Procedure. Also I created a New Project Standard EXE and clicked the code and insert your code into form opened and then I run it .
The code window that you opened up is the General Declarations section of the form.
Variables that will be used through the form are declared there. API declarations for calls that will be used through the form are declared there. But, event driven code, like what you are using to open your word document, must be used in a control's click event, or in a sub or function that is called by the controls click event.
Is there any way to deploy this program on the web
Thanks
Nike
That sample code is for VB. I think you can translate it into VBScript, but I'm not sure. Also, in order for it to work, the user has to have Word installed locally. Can you be sure that all people visiting your web page will have Word installed on their PC?