macros and SharePoint WSS document libraries

S

ssr

Hi,
I am new at macros. I have a macro that is stored in a document project
in "this document". When run, the macro opens a second document and
passes values entered by the user into the first document into
corresponding fields in the second document. This works well from Word.

Now, the first document is used as a template in a document library in
a SharePoint WSS site stored in the Forms folder where the template is
typically kept. The template is used when the user clicks on New
Document from within the document library.

I tried this two ways and am unable to get this to work.
1. I tried using the template as a .doc which is typcially how it is
done. When I create a new document, the code is passed to the new
document, but when I try to run the macro from Word (Tools > Macros >
Macro > Run) the macro is not listed.

I tried creating a module and copying the code into it, with the same
results.

If I press Alt+F11, I see the code and can run it from the VBA menu,
but not from the Word document.

2. The same results occur if I use template.dot.

I am confused as to why the code is not attaching itself to a new
document that is created through the document library, and where the
code should be stored. In the project for the document called "this
document" or in a module. This is code that is written and not
recorded.

I appreciate any help you can provide as I have spent many hours on
this. Thank you.
 
S

ssr

I now have the macro working with a command button but have another
problem.

1. The first document is opened in the browser from a SharePoint
dataview.
2. The second document opens upon clicking the command button.
3. The user fills out the second document, saves it and closes it.
4. The first document is still open. The user can do one of two
things: He can click the close button or click the back button to
return to the SharePoint screen in the WSS site from which he opened
the document.

When the user does either of the actions mentioned in 4), an empty Word
window shows with the Word menu.

How can I avoid that empty window. I would like the user to go directly
back to SharePoint WSS without seeing an empty Word window.

Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top