-----Original Message-----
OK, I don't know what happened to my posting previous to
the one below. I don't see it here, but it's sitting in
my Sents. Here it is again: -MT
From: Mark Tangard <
[email protected]>
Subject: Re: Working with multiple computers
Newsgroups: microsoft.public.word.vba.beginners
Aha!
Is it a template thing? References? Bill Gates? Al Gore?
It's a template thing. More specifically, an AutoText
thing. Your AutoTexts are what contain the pictures.
(The pictures in the form aren't being pasted; once you
stick a picture in a form, it's not available for doing
much else with.) What's being pasted is the AutoTexts
you created (picture1, picture2, etc.), and according
to your code, they live in your Normal template, which
of course doesn't travel with the template that contains
your form.
That's why it isn't working; your code looks for the
AutoText 'picture1' in the Normal template of the foreign
machine, and finds that that member (picture1) of that
collection (AutoTextEntries) isn't there.
To fix: You need to move them from your Normal template
to the form template. Since you have several pictures,
the best way to move them is by using the Organizer.
Gee, I hope you're using Word 2000 or earlier, because
I don't have a clue how to reach the Organizer in Word
2002 with its all-new-all-perverse Style menu....
Assuming you're in 2000 or 97:
Directly open the template that contains your form.
(Directly = by File->Open, not by double-clicking it
in Explorer). Click Format-> Style, and click the
Organizer button. You'll see a two-box dialog with
4 tabs at the top. Click the AutoText tab. One of
the boxes will be titled "In Normal.dot" and will be
full of AutoText names, including your pictures. The
other will be titled "To [name of your form template]"
and will likely be empty.
Select the picture AutoTexts in the Normal template
(you can select lots at a time by holding Shift) and
click COPY to send them to your form template.
When you're done, click Close. Save your template.
Now open your template in the Visual Basic Editor.
In that line of code (and all others like it --
I assume you have several), change:
NormalTemplate
to:
ThisDocument.AttachedTemplate
Save, exit, and test it. It should work now.
When you're sure it works, you'll probably want to
go back to the organizer and DELETE the AutoTexts
from your Normal template, so you won't end up with
2 sets (and also to keep your Normal template lean;
all those pictures have doubtless made it rotund).
Hope this helps.
--
Mark Tangard <
[email protected]>, Microsoft Word MVP
Please reply only to the newsgroup, not by private email.
Note well: MVPs do not work for Microsoft.
"Life is nothing if you're not obsessed." --John Waters
Thanks Mark for the prompt reply.
Yes, all the obvious stuff is well double/triple checked.
When I run my form on a different computer, I get this
message:
"Runtime error 5941. The requested member of the
collection does not exist."
The computers have the same references selected. The
pictures are not linked to on any computer; rather, they
are pasted on image boxes on my userform. i.e., I put
image boxes on the userform and inserted pictures via
the 'picture' tool on the properties box. The pictures
show up on a diff comp when I show the form, they just
won't paste onto my document.
The highlighted line in my code is this:
NormalTemplate.AutoTextEntries("image1").Insert
where:=ActiveDocument.Bookmarks("picture1").Range
Is it a template thing? References? Bill Gates? Al Gore?
.