Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / January 2007

Tip: Looking for answers? Try searching our database.

How to call objects in VB3 style?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Brian - 26 Jan 2007 15:06 GMT
I am trying to call some Word functions from lotusscript which uses the VB3.0
syntax of passing parameters in order (instead of the paramname:=paramvalue
syntax).

Where can I find the correct order for the Word method calls?

I'm trying to do, for example, this:

   Selection.InlineShapes.AddOLEObject ClassType:="Package", FileName:= _
       "C:\Documents and
Settings\gallagb.CAIWIL\Desktop\dilbert-buzzword.jpg", _
       LinkToFile:=True, DisplayAsIcon:=True, IconFileName:= _
       "C:\WINDOWS\system32\cmmon32.exe", IconIndex:=0, IconLabel:= _
       "C:\Documents and
Settings\gallagb.CAIWIL\Desktop\dilbert-buzzword.jpg"

But it would have to be like this:

  Selection.InlineShapes.AddOLEObject  option1, option2, ... etc.

Where can I find a reference that lists the correct order for the various
Word object calls?
Jay Freedman - 26 Jan 2007 16:19 GMT
The Word VBA Help shows the syntax in the required order. For example:

expression.AddOLEObject(ClassType, FileName, LinkToFile, DisplayAsIcon,
IconFileName, IconIndex, IconLabel, Range)

where "expression" is an expression that returns an InlineShapes object.

You can copy/paste that syntax into the LotusScript editor and then replace
the parameters with your values/variables.

If the VBA editor and its help aren't handy but you have Internet access,
the help is online. For example, for Word 2003 you need the Word VBA
reference
http://msdn2.microsoft.com/en-us/library/aa272078(office.11).aspx and the
Office VBA reference
http://msdn2.microsoft.com/en-us/library/aa271312(office.11).aspx.

As another way, if you type the first part of the statement into the VBA
editor

   Selection.InlineShapes.AddOLEObject

you can get an IntelliSense tag with the parameters in the correct order by
typing a space or left parenthesis after the keyword, or by clicking Edit >
Parameter Info (shortcut = Ctrl+Shift+I). Unfortunately, there's no way to
copy that to the clipboard.

Signature

Regards,
Jay Freedman
Microsoft Word MVP        FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

> I am trying to call some Word functions from lotusscript which uses
> the VB3.0 syntax of passing parameters in order (instead of the
[quoted text clipped - 18 lines]
> Where can I find a reference that lists the correct order for the
> various Word object calls?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.