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 / Word / Programming / October 2005

Tip: Looking for answers? Try searching our database.

macros and SharePoint WSS document libraries

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ssr@lubrizol.com - 06 Oct 2005 11:09 GMT
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.
ssr@lubrizol.com - 08 Oct 2005 04:03 GMT
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.
 
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.