Results 1 to 2 of 2

Thread: VBA - Word

  1. #1
    BMike
    Guest

    VBA - Word

    I need to change values in formfields of my document and update all this
    fields where used.
    With Word.Basic i use these commands:

    oWord.SetFormResult("Text1","HELLO",1)
    ......
    oWord.EditSelectAll
    oWord.UpdateFields

    With Word.Application is it possible ?

    Thanks

  2. #2
    calacuccia
    Guest

    Re: VBA - Word

    Hi,

    For a complete (or as complete as Microsoft considers necessary) list of WordBasic to VBA correspondencies, bookmark this article

    <A target="_blank" HREF=http://www.microsoft.com/TechNet/Word/technote/word2vba.asp>http://www.microsoft.com/TechNet/Wor...e/word2vba.asp</A>

    For your specific question, use this:

    oWord.ActiveDoument.FormFields("Text1").TextInput. EditType Type:=wdRegularText, Default:="HELLO", Format:=""
    ....
    oWord.Selection.WholeStory
    oWord.Selection.Fields.Update

    Or you still can use your WordBasic methods, but need to do this

    oWord.WordBasic.SetFormResult("Text1","HELLO",1)
    ......
    oWord.WordBasic.EditSelectAll
    oWord.WordBasic.UpdateFields

Posting Permissions

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