Results 1 to 5 of 5

Thread: [RESOLVED] Can you "label" sections of a word doc as reference points?

  1. #1

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091

    Resolved [RESOLVED] Can you "label" sections of a word doc as reference points?

    Okay, I don't do much in the way of VBA stuff, so please forgive me if I sound like an idiot (well, more than I normally do ).

    So I've got this word doc that I am using as a template for program documentation. I also have an xml file that describes each screen. What I would like to do is take the contents of that xml file and match it to different parts of the document. For example..there is a textbox on the first page that is for the title. So I have a <title> tag in the xml and I would like to put its contents into that textbox.

    So is there a way for me to tag that textbox as "title", so as I am going through the object model I could do something like...

    Code:
    document.Fields("title").Select
    Selection.TypeText Text:="Some Title"
    Is this possible?
    Last edited by crptcblade; Feb 24th, 2006 at 08:40 AM.
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  2. #2
    Frenzied Member DKenny's Avatar
    Join Date
    Sep 2005
    Location
    on the good ship oblivion..
    Posts
    1,171

    Re: Can you "label" sections of a word doc as reference points?

    If your txtbox is an ActiveX control, then you can set its name property to anything you like. You can then set its text property as follows. (My example textbox is named "txtTitle")

    VB Code:
    1. ThisDocument.txtTitle.Text = "Declan"
    Declan

    Don't forget to mark your Thread as resolved.
    Take a moment to rate posts that you think are helpful

  3. #3

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091

    Re: Can you "label" sections of a word doc as reference points?

    No, this textbox would be of the type found in the Drawing menu in Word. But what I am trying to do is not limited to things like that. I need to be able to define certain areas that will contain certain data. For example...

    first Title (text box)
    then TOC (table of contents)
    then Introduction (free form text)
    then Screenshot
    etc

    and be able to fill in those specific sections with the data that pertains to them.
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  4. #4
    Frenzied Member DKenny's Avatar
    Join Date
    Sep 2005
    Location
    on the good ship oblivion..
    Posts
    1,171

    Re: Can you "label" sections of a word doc as reference points?

    Have you considered using bookmarks? Here's an example where I'm adding 2 pieces of text at pre-defined insertion points.
    Attached Files Attached Files
    Declan

    Don't forget to mark your Thread as resolved.
    Take a moment to rate posts that you think are helpful

  5. #5

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091

    Re: Can you "label" sections of a word doc as reference points?

    I believe that will work just fine. Thanks

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

Posting Permissions

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



Click Here to Expand Forum to Full Width