-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Header / Footer Support #13
Comments
I really need to make libraries consistent with current versions of OfficeIMO |
Bumping this one up, It looks like there's still no header/footer support, but appears to be in OfficeIMOI. |
I'm pretty sure the current version on PowerShellGallery has support for AddHeadersFooters. Have you tested it? As for missing Lib, it's because I decided you need to build it yourself using Build script if you want to play with adding new features. We're not supposed to upload binary files to GIT. |
@PrzemyslawKlys I could be doing something wrong, but I cannot find any evidence there's support in the module other than REMOVING headers currently. I suspect it's a bit behind IMO. From what I can see between the docs, and checking PS: I'd submit a PR to fix it if I had the C# knowledge, but I'm not quite there yet, unfortunately. |
It's maybe not straightforward but everything doable in C#, all the methods are available. $Document = New-OfficeWord -FilePath $PSScriptRoot\Documents\BasicDocument.docx
$Document.Settings.FontFamily = 'Times New Roman'
$Document.AddHeadersAndFooters()
$MyParagraph = $Document.Header.Default.AddParagraph("This is a header")
New-OfficeWordText -Document $Document -Text 'This is a test, very big test ', 'and this should be bold' -Bold $null, $true -Underline Dash, $null
New-OfficeWordText -Document $Document -Text 'This is a test, very big test', 'ooops' -Color Blue, Gold -Alignment Right
$Paragraph = New-OfficeWordText -Document $Document -Text 'Centered' -Color Blue, Gold -Alignment Center -ReturnObject
New-OfficeWordText -Document $Document -Text ' Attached to existing paragraph', ' continue' -Paragraph $Paragraph -Color Blue
Save-OfficeWord -Document $Document -Show Wrapping it up into easier PowerShell commands takes effort and time and currently I lack time. Same goes for properties of given Paragraph for example: $Document | Get-Member I will release new version soon, but mostly just with new DLL, not with fully functional PowerShell cmdlets |
THANK YOU @PrzemyslawKlys . :) That solves the case right there. I'm looking for standalone cmdlets while they're sitting as methods. I'll try to devote some effort to docs/examples, if that's alright with you? :) |
Sure, why not. Just a warning - people who say that - usually end up realizing it's harder than it seems and never come back 😂🤣 You can always write wrapper around those commands and do PRs for that. I guess effectively we should have similar options as PSWriteWord project. |
Does the current release support adding headers and footers to a Word document?
The text was updated successfully, but these errors were encountered: