Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Looping Program


Hi,
I was recently assigned a task to make a company's files CMMI compliant
which would involve going through Word, Excel, Powerpoint and Visio
documents and putting in specific footers and etc. Can someone provide
a skeleton for the code required to search a drive for those files open
them, edit the footers, close them and repeat.
much appreciated...


--
bs272
------------------------------------------------------------------------
bs272's Profile: http://www.excelforum.com/member.php...o&userid=36812
View this thread: http://www.excelforum.com/showthread...hreadid=565200

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Looping Program

You can turn on the macro recorder and change the footers manually, then turn
it off and get some insights for the code to do that.

sPath = "C:\Myfolder\"
sname = Dir(spath & "*.*")
do while sname < ""
iloc = Instr(1,sname,".",vbTextcompare)
if iloc < 0 then
ext = lcase(Right(sname,len(sName)-iloc))
Select Case ext
Case "xls"
set bk = Workbooks.Open(sPath & sName)
' update data
bk.close Savechanges:=True
Case "ppt"

Case "doc"

end Select
sName = dir
Loop


You will need to automate Word and Powerpoint. Here is a link to the
automation help file which has some examples:

http://support.microsoft.com/?id=167223
Microsoft Office 97 Automation Help File Available on MSL


That is in the older help format. Here is one in the CHM help format:
http://support.microsoft.com/?id=260410
OFF2000: Microsoft Office 2000 Automation Help File Available

and another source:
http://support.microsoft.com/?id=253338
INFO: Office Developer Samples and Tools Available for Download

--
Regards,
Tom Ogilvy


"bs272" wrote:


Hi,
I was recently assigned a task to make a company's files CMMI compliant
which would involve going through Word, Excel, Powerpoint and Visio
documents and putting in specific footers and etc. Can someone provide
a skeleton for the code required to search a drive for those files open
them, edit the footers, close them and repeat.
much appreciated...


--
bs272
------------------------------------------------------------------------
bs272's Profile: http://www.excelforum.com/member.php...o&userid=36812
View this thread: http://www.excelforum.com/showthread...hreadid=565200


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a way to unload the loaded XLL file in Excel? Hi all, I amdebugging XLL link library using Visual C++. Everytime I rebuild the XLL, Ihave to close the whole Excel program and relaunch the Excel program again,and then load in the newly gene LunaMoon Excel Discussion (Misc queries) 0 July 28th 08 11:03 PM
looping every third row Jason Hancock Excel Programming 5 July 1st 04 08:00 PM
merging excel program with tdc finance program judy Excel Programming 0 November 5th 03 08:01 PM
Looping [email protected] Excel Programming 0 October 31st 03 07:47 PM
Looping J.E. McGimpsey Excel Programming 0 October 29th 03 11:09 PM


All times are GMT +1. The time now is 03:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"