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 / Publisher / Programming / August 2005

Tip: Looking for answers? Try searching our database.

Shapes Moved to the wrong pages using VBA

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rick Ruud - 10 Aug 2005 11:19 GMT
I'm using VBA to construct a new publisher document (Publisher 2003) from an
existing publisher document. I open the old document in a new instance of
publisher and then determine the number of pages needed in the new doc and
add them.

I then go thru and select groups of shapes from the old document and
transrfer them to the new document through the clipboard. The logic for
selecting the shapes works fine and the logic for determining the page to
pasted to works fine.

The problem I'm having is that the shapes are being pasted to the wrong
pages. When I run the code at full speed the groups of shapes are posted all
over the place many overlaying pages. The shapes are all there but pages are
either blank or overlayed.

When I run the same code with a breakpoint before each copy and paste
operation most of the pages are pasted to correctly but the last few have
some overlays.

Any ideas would be appreciated.
Signature

Rick Ruud
Palisades Computers LLC
North Canton & Columbus, Ohio

Ed Bennett - 10 Aug 2005 11:27 GMT
> When I run the same code with a breakpoint before each copy and paste
> operation most of the pages are pasted to correctly but the last few
> have some overlays.

A very interesting problem.
I can't say I've ever encountered it myself (a lot of use I am)

Have you tried adding a DoEvents before each copy and paste?

Signature

Ed Bennett - MVP Microsoft Publisher

Rick Ruud - 10 Aug 2005 11:42 GMT
Thanks for replying Ed. No I haven't, but at this point I'm ready to try
anything. I'll post back if it helps.
Signature

Rick Ruud
Palisades Computers LLC
North Canton & Columbus, Ohio

> > When I run the same code with a breakpoint before each copy and paste
> > operation most of the pages are pasted to correctly but the last few
[quoted text clipped - 4 lines]
>
> Have you tried adding a DoEvents before each copy and paste?
Rick Ruud - 17 Aug 2005 18:34 GMT
Thanks Ed,

The DoEvents did clear up some overlay problems and revealed a
well-concealed bug in my code.
Signature

Rick Ruud
Palisades Computers LLC
North Canton & Columbus, Ohio

> Thanks for replying Ed. No I haven't, but at this point I'm ready to try
> anything. I'll post back if it helps.
[quoted text clipped - 7 lines]
> >
> > Have you tried adding a DoEvents before each copy and paste?

Rate this thread:






 
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.