Click here to Skip to main content
15,905,607 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: How To Read Local Machine Time Pin
Mycroft Holmes18-Apr-08 22:46
professionalMycroft Holmes18-Apr-08 22:46 
GeneralRe: How To Read Local Machine Time Pin
Dave Kreskowiak19-Apr-08 4:11
mveDave Kreskowiak19-Apr-08 4:11 
GeneralRe: How To Read Local Machine Time Pin
Mycroft Holmes19-Apr-08 13:52
professionalMycroft Holmes19-Apr-08 13:52 
AnswerRe: How To Read Local Machine Time Pin
Parwej Ahamad18-Apr-08 8:14
professionalParwej Ahamad18-Apr-08 8:14 
AnswerRe: How To Read Local Machine Time Pin
ktomecek19-Apr-08 15:47
professionalktomecek19-Apr-08 15:47 
Questionlooking for more efficient way to concatinate values in a datatable Pin
camatulli18-Apr-08 4:30
camatulli18-Apr-08 4:30 
GeneralRe: looking for more efficient way to concatinate values in a datatable Pin
Dave Kreskowiak18-Apr-08 8:05
mveDave Kreskowiak18-Apr-08 8:05 
GeneralRe: looking for more efficient way to concatinate values in a datatable Pin
camatulli18-Apr-08 8:11
camatulli18-Apr-08 8:11 
GeneralMail Merge Question Pin
jchigg200018-Apr-08 4:14
jchigg200018-Apr-08 4:14 
GeneralRe: Mail Merge Question Pin
jchigg200018-Apr-08 4:27
jchigg200018-Apr-08 4:27 
GeneralRe: Mail Merge Question Pin
camatulli18-Apr-08 4:34
camatulli18-Apr-08 4:34 
GeneralAdding Metadata Using Visual Basic 2008 Pin
Harold_Wishes18-Apr-08 3:35
Harold_Wishes18-Apr-08 3:35 
GeneralRe: Adding Metadata Using Visual Basic 2008 Pin
Dave Kreskowiak18-Apr-08 4:27
mveDave Kreskowiak18-Apr-08 4:27 
GeneralPrinting Text File In Dot Matrix Printer Pin
Member 366452518-Apr-08 2:08
Member 366452518-Apr-08 2:08 
GeneralRe: Printing Text File In Dot Matrix Printer Pin
Dave Kreskowiak18-Apr-08 4:23
mveDave Kreskowiak18-Apr-08 4:23 
Questioncapture Pin
swathi chandra18-Apr-08 1:21
swathi chandra18-Apr-08 1:21 
GeneralRe: capture Pin
Smithers-Jones18-Apr-08 1:40
Smithers-Jones18-Apr-08 1:40 
GeneralRe: capture Pin
manavharsh18-Apr-08 3:24
manavharsh18-Apr-08 3:24 
QuestionQuick question on config file Pin
AHeavey17-Apr-08 23:54
AHeavey17-Apr-08 23:54 
GeneralRe: Quick question on config file Pin
Christian Graus18-Apr-08 0:34
protectorChristian Graus18-Apr-08 0:34 
GeneralRe: Quick question on config file Pin
AHeavey18-Apr-08 0:36
AHeavey18-Apr-08 0:36 
GeneralHelp with Integrating MS Word in VB.NET Pin
Jats_4ru17-Apr-08 23:27
Jats_4ru17-Apr-08 23:27 
GeneralRe: Help with Integrating MS Word in VB.NET Pin
parth.p18-Apr-08 0:19
parth.p18-Apr-08 0:19 
GeneralRe: Help with Integrating MS Word in VB.NET [modified] Pin
Jats_4ru18-Apr-08 1:53
Jats_4ru18-Apr-08 1:53 
Here is the code to save the contents in a different file...

Here is the code, Add reference to Microsoft Word 11.0 Library
<br />
Imports Microsoft.Office.Interop.Word<br />
Imports System.Data<br />
Imports System.Data.OleDb<br />
Imports System.Data.SqlClient<br />
Imports System.Configuration<br />
<br />
<br />
Public Class form1<br />
    Dim WithEvents wordApp As New Microsoft.Office.Interop.Word.Application<br />
    Dim WithEvents doc As New Microsoft.Office.Interop.Word.Document<br />
    Dim strSaveFile As String = "C:\Test\Retrive_the_data.doc"<br />
<br />
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
                'Create a Word App<br />
<br />
        wordApp.Visible = False<br />
<br />
        With wordApp<br />
            .Documents.Open(strSaveFile)<br />
            'Clipboard.SetText("lpt ", TextDataFormat.Text)<br />
            'wordApp.Selection.InsertParagraph()<br />
            'wordApp.Selection.Paste()<br />
<br />
            Dim strsaveasfile As String = "c:\Test\retry.doc"<br />
            Try<br />
                If (strSaveFile <> String.Empty) And (Not (IsNothing(strSaveFile))) Then<br />
                    .ActiveDocument.SaveAs(strSaveFile)<br />
                    .ActiveDocument.SaveAs(strsaveasfile)<br />
                End If<br />
            Catch ex As Exception<br />
                MsgBox(ex.Message)<br />
            End Try<br />
<br />
            .Visible = True<br />
            .Activate()<br />
        End With<br />
<br />
        System.Runtime.InteropServices.Marshal.ReleaseComObject(wordApp)<br />
    End Sub<br />
<br />
End Class<br />


Now i just have to deactivate the Save as button in MS Word.
And if it is possible i would also like to block Title bar and Menu bar.

Jats

modified on Friday, April 18, 2008 8:23 AM

GeneralRe: Help with Integrating MS Word in VB.NET Pin
parth.p18-Apr-08 2:46
parth.p18-Apr-08 2:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.