Re: VB Code formats by Perry
Perry
Wed Jan 07 13:05:59 CST 2004
Not using the parameter names, you'll have to stick to
the sequence in which the parameters are passed to
a function/routine.
for starters:
AddPicture expects 3 parameters in a particular sequence.
If you want to set the 'SaveWithDocument' parameter to True
following code will work
<> .InlineShapes.AddPicture(strImageName, , True)
Following line will not set the 'SaveWithDocument' param to True
Instead, it will set LinkToFile to True:
Y're passing 2 parameters and without the reference/name, the value is
passed to
second parameter in sequence, namely: LinkToFile (and not to:
SaveWithDocument)
<> .InlineShapes.AddPicture(strImageName, True)
Following line does set the 'SaveWithDocument' param to True
despite of the fact that y're passing only 2 parameters
<> .InlineShapes.AddPicture(FileName:=strImageName, SaveWithDocument:=True)
Note: you can only skip parameters from being passed, if they're optional !!
Krgrds,
Perry
"sestyd@yahoo.com" <anonymous@discussions.microsoft.com> wrote in message
news:008f01c3d54e$e51db2c0$a501280a@phx.gbl...
> Can someone tell me what the deal is with this format
> (just pretend no wraps):
>
> .Paragraphs(2).Range.InlineShapes.AddPicture
> FileName:=strImageName, LinkToFile:=False,
> SaveWithDocument:=True
> (which I have never before encountered - is it really a
> method call? does it actually return a value?)
>
> as opposed to this format:
>
> Dim thisShape As InlineShape
> Set thisShape = .Paragraphs
> (2).Range.InlineShapes.AddPicture(strImageName, False,
> True)
>
> Vera
>
>
>
>