Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-14-2016, 07:28 AM
ika ika is offline Change Logo in Header in many Word-Documents Windows 8 Change Logo in Header in many Word-Documents Office 2013
Novice
Change Logo in Header in many Word-Documents
 
Join Date: Feb 2016
Posts: 12
ika is on a distinguished road
Default

HI Gmyaor



With help from others and google, I created the following code for updating the footers and the properties in wordfiles, located in a folder. How can I now implement your function?

Quote:
Sub SetDocPropsPlus()
'
' SetDocPropsPlus Makro

Dim dd1 As Document
Dim dokupfad As String, endung As String, dateiname As String

dokupfad = "C:\Users\CGL-TEAM1\Desktop\Test Ordner\" '**der Pfad, in dem die zu bearbeitenden Dokumente liegen anpassen!
endung = "*.docx" '**Anpassen, falls nötig!
dateiname = Dir(dokupfad & endung)

'**********Beginn der Schleife durch alle Dateien im Ordner ***************

Do While dateiname <> ""
Set dd1 = Documents.Open(FileName:=dokupfad & dateiname) 'öffnet das Dokument

'********************* Zu wiederholende "Arbeit"****************************************** *************

If Documents.Count > 0 Then
Dim dp As Object
Set dp = ActiveDocument.BuiltInDocumentProperties
dp("Title") = "© CGLN-Team und IKA GmbH 2017,2018,2019,"
dp("Subject") = "© CGLN-Team und IKA GmbH 2017,2018,2019,"
dp("Keywords") = "© CGLN-Team und IKA GmbH 2017,2018,2019,"
dp("Category") = "© CGLN-Team und IKA GmbH 2017,2018,2019,"
dp("Comments") = "© CGLN-Team und IKA GmbH 2017,2018,2019,"
dp("Author") = "© CGLN-Team 2017,2018,2019,"
dp("Company") = "© CGLN-Team und IKA GmbH 2017,2018,2019,"
dp("Manager") = "© CGLN-Team und IKA GmbH 2017,2018,2019,"
End If

'Fusszeile ganzer Inhalt erneuern

ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument

ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
Selection.WholeStory
Selection.Fields.Update
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument



'Dokument speichern
dd1.Save

'Dateien schliessen
dd1.Close
Set dd1 = Nothing


'********************Fortsetzung der Schleife durch alle Dokumente********************

dateiname = Dir ' nächste Datei

Loop

End Sub
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Change Logo in Header in many Word-Documents Macro to Insert Logo in header on 1st page only and bookmark it. youseeme Word VBA 9 09-16-2016 05:25 AM
Change Logo in Header in many Word-Documents How to change logo /dates in numerous word documents without changing each one individually? newi1 Word VBA 3 04-22-2016 07:02 PM
Change Logo in Header in many Word-Documents Can't change logo in Word 2007 jrasicmark Word 5 04-12-2016 10:35 AM
Change Logo in Header in many Word-Documents How to print header logo only in 1st page Shafraz Khahir Word 1 11-29-2010 11:52 AM
Is there a way to change the header in a large amount of documents at one time? ntsstaffing Word 1 07-11-2009 12:12 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:07 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft