CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 1999
    Posts
    10

    msoffice/vb-script

    I've made a macro in msword that inserts a image into the document but i don't know how to change the properties of the ole-object
    this is what i did


    If Selection.StoryType <> wdMainTextStory then
    Selection.HeaderFooter.Shapes.AddOLEControl Anchor:=Selection.Range, _
    ClassType:="Forms.Image.1"
    else
    ActiveDocument.Shapes.AddOLEControl Anchor:=Selection.Range, _
    ClassType:="Forms.Image.1"





  2. #2
    Join Date
    Apr 1999
    Location
    Latvia, Riga
    Posts
    36

    Re: msoffice/vb-script

    try this sample:

    'Set Calc = ActiveDocument.Shapes.AddOLEControl(ClassType:="Forms.CommandButton.1")
    'With Calc.OLEFormat.Object
    ' .Caption = "Calculator"
    ' .Top = 0
    ' .Left = 184
    ' .Events = PhoneCalculator.Show
    'End With

    it's added a CommandButton as OLE object with proger's defined properties

    good luck, ToXa


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

Featured