Heenan, Lambert
Lambert.Heenan at AIG.com
Wed Jun 11 14:21:24 CDT 2008
A quick check of the on-line help reveals that both Range and Selection objects have Text properties. So that .Text property is what you are after. strWholeStory = objWord.ActiveDocument.Selection.WholeStory.Text Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin at Beach Access Software Sent: Wednesday, June 11, 2008 3:10 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Automation Question I thought so to at first but there's something else I'm missing because I get 'Object doesn't support this property or method with Dim strWholeStory As String strWholeStory = objWord.ActiveDocument.Selection.WholeStory I think I have to make this a range or something? And then grab the text? TIA Rocky Smolin Beach Access Software 858-259-4334 www.e-z-mrp.com www.bchacc.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, June 11, 2008 11:58 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Automation Question Recorded a Macro in Word. Then looked at macro... Selection.WholeStory ... Seems to be what you want. :-) Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin at Beach Access Software Sent: Wednesday, June 11, 2008 1:58 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Automation Question Dear List: What is the syntax for selecting all the text in a word document from VBA? I've got the document open. Just need to copy all the text from it into a string variable. MTIA Rocky Smolin Beach Access Software 858-259-4334 www.e-z-mrp.com <http://www.e-z-mrp.com/> www.bchacc.com <http://www.bchacc.com/> -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG. Version: 8.0.100 / Virus Database: 270.2.0/1497 - Release Date: 11/6/2008 08:32 -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com