Stella said:
the macro should insert a picture from c:/my pictures
than insert a page
than insert another picture from c:/my pictures
than insert a page and so forth
Can someone tell me how to write the code?
The command for Insert Page is (Document object).Pages.Add. (Document
object) is either ThisDocument (if you are macro writing);
ActiveDocument (if you're writing an add-in); or another document object
that you've created (if you're automating Publisher from another
application).
The command for Insert Shape is (Page object).Shapes.AddPicture. (Page
object) can be (Document object).ActiveView.ActivePage, or you can Set
the page you created in the first step to be in a variable (e.g.
CurrentPage), and refer to that instead.
The syntax for both these commands is in the Publisher VBA Help file. To
access this, in Publisher 2002 or 2003 you can simply open c:\Program
Files\Microsoft Office\Office1?\1033\VBAPB10.CHM, where ? is 0 for
Publisher2002 and 1 for Publisher 2003; 1033 will change if you copy of
Publisher isn't in US English. In all versions you can hit F1 in the VBA
IDE to bring up help, too.