14/01/10 21:55
lyuka
Vi invio il codice che ho elaborato. Potete darci un'occhio e sapermi dire dove sbaglio?
1000 Grazie
Option Explicit On
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim word_server As Microsoft.Office.Interop.Word.Application
Dim wordDoc As Microsoft.Office.Interop.Word.Document
'definisce word_server come nuova applicazione word
word_server = New Microsoft.Office.Interop.Word.Application
'Apre il file "Questa è una prova"
wordDoc = word_server.Documents.Open("C:\Questa è una prova.docx"
word_server.Selection.GoTo(What:=word_server.WdGoTo.Item.wdGoToSegnalibro, Name:="Pippo"
word_server.Selection.TypeText(Text:="Questo è un segnalibro"
word_server.Visible = True
'Rende visibile il file
word_server.Visible = True
wordDoc = Nothing
word_server = Nothing
End Sub
End Class
1000 Grazie
Option Explicit On
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim word_server As Microsoft.Office.Interop.Word.Application
Dim wordDoc As Microsoft.Office.Interop.Word.Document
'definisce word_server come nuova applicazione word
word_server = New Microsoft.Office.Interop.Word.Application
'Apre il file "Questa è una prova"
wordDoc = word_server.Documents.Open("C:\Questa è una prova.docx"
word_server.Selection.GoTo(What:=word_server.WdGoTo.Item.wdGoToSegnalibro, Name:="Pippo"
word_server.Selection.TypeText(Text:="Questo è un segnalibro"
word_server.Visible = True
'Rende visibile il file
word_server.Visible = True
wordDoc = Nothing
word_server = Nothing
End Sub
End Class
aaa