Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
PrzemyslawKlys committed Mar 21, 2020
1 parent 6b7df74 commit 3bc4524
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Examples/Example-Bookmarks/Example-BookmarksByText.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ $FilePathTemplate = "$PSScriptRoot\Templates\CV-WithTextReplacement.docx"
$WordDocument = Get-WordDocument -FilePath $FilePathTemplate

foreach ($Paragraph in $WordDocument.Paragraphs) {
$Paragraph.ReplaceText('JOB TITLE', 'CEO of EVOTEC')
# You can display text as seen by PSWriteWord
$Paragraph.Text
# Case sensitive
$Paragraph.ReplaceText('Job Title', 'CEO of EVOTEC')
$Paragraph.ReplaceText('School Name 1st', 'Oh my school')
$Paragraph.ReplaceText('School Name 2nd', 'Oh my school 2')
$Paragraph.ReplaceText('Name Here', 'Przemysław Kłys')
# While word shows NAME HERE, actually it's Name HERE
$Paragraph.ReplaceText('Name HERE', 'Przemysław Kłys')
$Paragraph.ReplaceText('PHONE_NUMBER', '+48 500 500 500')
}

Save-WordDocument -WordDocument $WordDocument -FilePath "$PSSCriptRoot\Output\CV-WithReplacedText.docx" -OpenDocument
Save-WordDocument -WordDocument $WordDocument -FilePath "$PSSCriptRoot\Output\CV-WithReplacedText.docx" -OpenDocument -Supress $true
Binary file not shown.
Binary file removed Examples/Templates/CV-WithBookmarks.docx
Binary file not shown.

0 comments on commit 3bc4524

Please sign in to comment.