Results 1 to 5 of 5

Thread: Bookmarks in Word

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Location
    Plano (Dallas) TX
    Posts
    3

    Question

    I'm trying to access Bookmarks in Word and place text in the
    document at that point. I can get VB6 to open Word and the template I'm using. However, I get an error message telling me I'm not using the syntax correctly.

    Can anyone HELP me!!!! PLEASE!!!!

    That's the only problem in this program.
    Juanita Stone

  2. #2
    Addicted Member
    Join Date
    May 2000
    Posts
    240

    Any Code?

    When vb says there is a syntax error, doesnt that mean that something wasnt spelled correctly?

    Maybe you could provide some code?

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Location
    Plano (Dallas) TX
    Posts
    3

    Smile

    Thanks Jeff,

    Here's some code. I'm being told that the object doesn't exist. However the bookmark ("LDate")does exist in the Word .dot file.

    'create Word object variable
    Set A = CreateObject("Word.Application")
    A.Visible = True 'show word
    'open a new document
    A.Documents.Open _
    "C:\Program Files\Microsoft Office\Templates\Proposals\NoBidLtr.dot"
    'write text to bookmarks in NoBid template
    ActiveDocument.Bookmarks("LDate") = ldate

    Thanks for your help.

    Juanita

    [Edited by JuanitaJJS on 06-13-2000 at 03:50 PM]
    Juanita Stone

  4. #4
    Fanatic Member RealisticGraphics's Avatar
    Join Date
    Jul 1999
    Location
    Arkansas
    Posts
    655
    Try changing the last line to

    A.ActiveDocument.Bookmarks("LDate").range = ldate
    www.RealisticGraphics.net

    Running VS.Net Enterprise & VB 6

    Other Languages: JavaScript, VBScript, VBA, HTML, CSS, ASP, SQL, XML

    MSN Messenger: kmsheff

  5. #5

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Location
    Plano (Dallas) TX
    Posts
    3

    Talking Thank you!!

    Thank you very much. It worked! I'm somewhat new to Visual Basic but have had other programming languages in college.

    Thanks again!
    Juanita
    Juanita Stone

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