Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Nov 2002
    Location
    Nieuwegein, Netherlands
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Change settings for openin Inlineshapes (Word 2000/SR-1)

    Hi Folks,

    can somebody give me some tips for the following problem:

    I'm inserting a document (as an embedded document) based on a template into another document via the following codesnippet:

    ...
    strFileName = ActiveDocument.AttachedTemplate.Path & "Tabel.dot"
    strIconFileName = Application.Path & "Winword.exe"

    Selection.InlineShapes.AddOLEObject ClassType:="Word.Document.8", FileName _
    :=strFileName, LinkToFile:=False, DisplayAsIcon:=True, _
    IconFileName:=strIconFileName, _
    IconIndex:=1, IconLabel:=cTableDocument
    ...

    When I executed the code, there is an embedded picture object and not an embedded document object.
    This used to work before, but I probably changed something in the convert screen (right click object, Picture object, Convert), telling Word to behave this way.
    When I try this at an other machine it works fine.

    Can somebody tell how to change this setting back to normal. I tried to start Word using the Run command
    "C:Program FilesMicrosoft OfficeOfficeWINWORD.EXE" -a, but it didn't reset this setting.

    Many thanks in advance!!
    Hans Meijer

  2. #2
    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: Change settings for openin Inlineshapes (Word 2000/SR-1)

    I stay away from embedding, but since no one else has responded yet, I took a look.

    Comments/questions in no particular order:

    (1) Is Word.Document.8 in the registry on both computers?

    (2) You are adding a .DOT file as a Word.Document.8 - but it's a template - are you sure this is the right identifier?

    (3) Online help for the AddOLEObject Method says: "You must specify either the ClassType or FileName argument for the object, but not both." However, the procedure runs anyway, perhaps ClassType is simply ignored.

    (4) I got a compile error on cTableDocument so I just put it in " marks.

    (5) When I test with .DOC and .DOT files on my own computer, this works flawlessly (unless I misspell the file name), so I'm afraid I can't help you identify the problem.

  3. #3
    New Lounger
    Join Date
    Nov 2002
    Location
    Nieuwegein, Netherlands
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Change settings for openin Inlineshapes (Word 2000/SR-1)

    Thanks for your reply!

    Very strange but the problem is gone. I didn't changed anything, but it works fine again.
    My comment to your replies:

    (1) Is Word.Document.8 in the registry on both computers?
    -Yes, it is on both.

    (2) You are adding a .DOT file as a Word.Document.8 - but it's a template - are you sure this is the right identifier?
    -I could try Word.Template.8, but it is embedding a document based on the template, so it should work.

    (3) Online help for the AddOLEObject Method says: "You must specify either the ClassType or FileName argument for the object, but not both." However, the procedure runs anyway, perhaps ClassType is simply ignored.
    -I will do a test using only the filename.

    (4) I got a compile error on cTableDocument so I just put it in " marks.
    -Ooops, my mistake.

    (5) When I test with .DOC and .DOT files on my own computer, this works flawlessly (unless I misspell the file name), so I'm afraid I can't help you identify the problem.
    -The problem is gone right now, I hope it stays this way!!

    Thanks again...

    Greetings Hans

Posting Permissions

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