Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-12-2022, 08:14 PM
getsubodh@gmail.com getsubodh@gmail.com is offline Open word document and copy Windows 11 Open word document and copy Office 2019
Novice
Open word document and copy
 
Join Date: Sep 2022
Posts: 1
getsubodh@gmail.com is on a distinguished road
Default 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.
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Make Userform Copy From One Word Document to Another Marrick13 Word VBA 0 03-19-2018 10:45 AM
look for a specific word in document and copy it to the filename sylvio Word VBA 4 03-09-2017 05:53 PM
Adding tables to Created word document whilst other word document open Help rpb925 Word VBA 18 03-30-2016 04:45 PM
Word Document won't open neusys Office 0 09-16-2013 12:05 AM
Open word document and copy Copy from one word document to another no identical gmurphy Word 3 09-07-2011 04:28 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:46 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft