Results 1 to 8 of 8
  1. #1
    3 Star Lounger
    Join Date
    Oct 2002
    Location
    Houston, Texas, USA
    Posts
    303
    Thanks
    0
    Thanked 0 Times in 0 Posts

    MS Word VBscript (MS Office 2003)

    Using MS Word VB code I have this line:

    SELECTION.FIND.TEXT = SearchText

    With just this can someone tell me how to replace it to use with MS Outlook vbscript?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: MS Word VBscript (MS Office 2003)

    What's the intended use of the code? Are you using Word as e-mail editor in Outlook?

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: MS Word VBscript (MS Office 2003)

    You are using VBScript in Outlook to search in a Word document? Normally then you would have an object reference to your word document, let's call it myDoc. The equivalent line would be --

    myDoc.ActiveWindow.Selection.Find.Text = SearchText

    -- because the Selection is a property of the ActiveWindow and not of the document itself.

  4. #4
    3 Star Lounger
    Join Date
    Oct 2002
    Location
    Houston, Texas, USA
    Posts
    303
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MS Word VBscript (MS Office 2003)

    At this time it is a MS Word Document that is being use to search for words in documents using this code. Why they don't use the Fine option in MS Word I don't know. The new goal is to see if they can use a MS Outlook - using MS Word as the default editor - to search for certain company names in a MS Access database and then later generate a different MS Outlook - to search again for certain company names in MS Word Documents.

    Not sure who is behind these request, I have just taken over a lot of projects from someone else.

  5. #5
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: MS Word VBscript (MS Office 2003)

    This is very confusing to us, as well as to you. And if they are in Outlook and want to search an Access database, launching Word does not seem like the best way to go about it. (Unless you want to run a merge, but that's a different story.)

  6. #6
    3 Star Lounger
    Join Date
    Oct 2002
    Location
    Houston, Texas, USA
    Posts
    303
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MS Word VBscript (MS Office 2003)

    I have taken over about 10 MS Outlook forms, 15 Excel Forms, 20 Word forms that someone designed. These forms do some strange things. THere is a MS Outlook form that will ask for the compnay name, address, and contact.. It then updates an Access database and displays the information in an Excel spreadsheet via a query.

    I have to see if I can streamline them, delete them or try to convert them into a more productive format. This last one is a MS Word that someone created a vb frontend to enter company name, address and contact. They feed the data to an Access database. Now they want to do the something using MS Outlook.

    Thinking of just cutting my time on it and say it can't be done.

  7. #7
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: MS Word VBscript (MS Office 2003)

    The conversion of Word VBA to Outlook VBA (for example, to be distributed as a COM Add-in) might be easier than converting to VBScript for use in a form. That's not to say it will actually work at the end of the day, but at least you have a better chance of being able to re-use the UserForm, among other things. But it might well be that you need to push back on these projects and suggest that they outsource the work, if it's really worth having it done at all.

  8. #8
    3 Star Lounger
    Join Date
    Oct 2002
    Location
    Houston, Texas, USA
    Posts
    303
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MS Word VBscript (MS Office 2003)

    Outsource? lol..sorry that will never be done. There is an entire programming team on the second floor, but due to polictics I can't get their help. For 3 years now I have been trying to convert these forms to another platform with no luck. As for training... About 4years ago I took a 4 hour free class on VB6 that was being offered. That is the extent of the training. That maybe why I am still using the wrong terminology for what I am wanting to do.

    Nope, I will just keep working on this stuff and create new stuff and try to convert the old. That is until I fine me a new job. Going to take a day off next week and go see a Headhunter.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •