Open word document and copy
Hi I am using the following code to open a word document
Sub Open_Word_Doc()
Dim intChoice As Integer
Dim strPath As String
Dim objWord As Object
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
Application.FileDialog(msoFileDialogOpen).AllowMul tiSelect = False
intChoice = Application.FileDialog(msoFileDialogOpen).Show
'if the user selects a file
If intChoice <> 0 Then
'get the path selected
strPath = Application.FileDialog( _
msoFileDialogOpen).SelectedItems(1)
'opens the document
objWord.Documents.Open (strPath)
End If
End Sub
I am trying to amend it so that i can copy all the contents of the word document (like Ctrl + A ) and copy it.
How can i do that.
Thanks in advance.
|