[AccessD] Automation Question

Edward S Zuris edzedz at comcast.net
Wed Jun 11 15:25:41 CDT 2008


 This might help

 The below works using Access 2000 launching Word 2000.


    ' *****************************************************
    ' *****************************************************
    '
    ' Written by:   Edward S. Zuris
    '
    ' Email:        edzedz at comcast.Net
    '
    ' Phone:        (505)-341-0069
    '
    ' Program View1
    '
    ' *****************************************************
    ' *****************************************************

 Public Function zzJpView1(zDocPath As String, zDocFile As String) As Long


    ' *****************************************************
    ' *****************************************************
    '  Merge Boiler Plate Section Files.
    ' *****************************************************
    ' *****************************************************

    Const cFileTypeWordDocuments = 3
    Const cmsoSortOrderAscending = 1
    Const cmsoSortOrderDescending = 2
    Const cmsoSortByFileName = 1
    Const cmsoSortBySize = 2
    Const cmsoSortByFileType = 3
    Const cmsoSortByLastModified = 4

    Dim objWd1App               As Word.Application
    Dim objWd1Doc               As Word.Document
    Dim objWd1Range             As Word.Range

    Dim sPathDoc                As String
    Dim sDocName                As String
 
    zzJpView1 = -1

    ' ****************************************************
    '  Parameter output path for Job Description documents
    '
    sPathDoc = ""
    sPathDoc = Trim$(zDocPath & " ")

    sDocName = ""
    sDocName = Trim$(zDocFile & " ")

    Set objWd1App = New Word.Application

    objWd1App.Application.Visible = False

    objWd1App.Documents.Open sPathDoc

    objWd1App.Documents(sDocName).Activate

    objWd1App.Application.Visible = True

    zzJpView1 = -2

   End Function


-----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 12: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



More information about the AccessD mailing list