View Single Post
  #6  
Old October 4th, 2004, 04:02 AM
Jay Freedman
external usenet poster
 
Posts: n/a
Default

Answers, in order of your questions, with more questions:

- When you say the code doesn't appear to work, exactly what are the
symptoms? Do you get an error message, or do you get wrong footers or
no footers in the documents, or does it seem that the macro doesn't
run at all? Exactly how are you trying to run the macro?

- Yes, the three references you list should be sufficient. The macro
runs on my system -- which is also Word 2003 on Windows XP Pro -- with
only those references selected.

- When the macro runs, it should open the Copy dialog; you should be
able to navigate to the topmost folder of the group you want to work
on and click OK, and that path is returned to the macro. This part of
the macro is exactly the same as the one you posted, which you said
was working except for not doing subfolders.

- If you get an error message about a syntax error, I suspect you
might be having trouble with extra line breaks introduced into the
code by the newsgroup posting mechanism. In the VBA editor, are there
any lines in red? If so, which ones?

- Yes, the o in oFolder is deliberate. It's a bad idea to name
variables the same as data types or other keywords of the VBA
language, which can lead to confusion. The o (which stands for object)
distinguishes the variable oFolder from the data type Folder. This is
based on a system called "Hungarian notation" (invented by Charles
Simonyi), which you can read about at
http://msdn.microsoft.com/library/te...hunganotat.htm.

--
Regards,
Jay Freedman http://aspnet2.com/mvp.ashx?JayFreedman
Microsoft Word MVP FAQ: http://word.mvps.org

(helpserv) wrote:

Hi Jay, and all the others out there willing to help others:

Installed the code as provided, after making the required selection of
the Microsoft Scripting Runtime-- however the code does not appear to
work (most likely something we are unaware of how to do).

We note the following References are selected: Visual Basic for
Applications, Microsoft Word 11.0 Object Library and Microsoft
Scripting Runtime are the only 3 References selected. Are they the
only ones necessary for this code to work properly? Are they the
correct references?

We are using Word 2003, as part of Office 2003 on a Windows XP
Professional operating system.

There is an issue with the process of the path and how the file
folders are selected. Are we supposed to enter manually into the
code, the path? Or are we supposed to be seeing a window of some kind
where we make the actual selection.

We pasted the code as offered into notepad and then copied it into the
Macro editor. Are there any modifications of any kind supposed to be
entered into the code by us? Or are we supposed to be able to use the
code as written exactly?

By the way, there appears in the code suggested, places where there
are o's in what otherwise wouldn't spell a word. For example see the
second line to follow where the word folder is preceded by the o:
Public Sub OnlyPrint()
Dim fs As FileSystemObject, oFolder As Folder
Dim PathToUse As String

Is the o that appears periodically throughout the code supposed to be
there?


Thank you for your consideration. Please be aware this macro is for
use by a non profit youth program that does not discriminate in its
membership and no one is turned away if they can not afford
membership. Your assistance is appreciated and profoundly makes a
difference.