Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-05-2021, 12:10 PM
Cendrinne's Avatar
Cendrinne Cendrinne is offline Help with access Lists Gallery to Format all Windows 10 Help with access Lists Gallery to Format all Office 2019
Competent Performer
Help with access Lists Gallery to Format all
 
Join Date: Aug 2019
Location: Montreal Quebec Canada
Posts: 190
Cendrinne is on a distinguished road
Default Help with access Lists Gallery to Format all

Hello Pros,
I've been searching for months to find a way on my own, but I'm giving up and asking again for your guidance.

When a PDF document is converted to Word, I find all the lists (numbers, alphabets, bullets), are either enlarged or reduced in size, so you can see in the Font window, under Advanced settings (2nd tab), the Scale is Not 100%, and often the Spacing is Not set to Normal.

I've created for myself a macro to fix the Fonts to 100% and Spacing, as below:

HTML Code:
    With Selection.Font
        .Name = ""
        .Spacing = 0
        .Scaling = 100
        .Position = 0
        .Kerning = 0
        .Ligatures = wdLigaturesNone
        .NumberSpacing = wdNumberSpacingDefault
        .NumberForm = wdNumberFormDefault
        .StylisticSet = wdStylisticSetDefault
        .ContextualAlternates = 0
    End With
Now I would like to apply it to all the different types of Lists in a Word Document.


Numbered, Alphabetics, and Bullets.
With all the levels, and including Multilevel, or single list.

My Research on the topic, led me to understand, I need to access the List Galery.????
I'm still confused on this whole topic. Is it easily accessible?

Is it doable? All combinations I do, do not work and can't find scripts about it, or I don't understand.

Any insights you could share with me?

Happy Easter by the way, and thanking you in advance

Cendrinne
Reply With Quote
  #2  
Old 04-05-2021, 04:59 PM
Guessed's Avatar
Guessed Guessed is offline Help with access Lists Gallery to Format all Windows 10 Help with access Lists Gallery to Format all Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

When a pdf is converted back to Word, the 'list' paragraphs are going to be hard coded. You might be allowing Word to convert these to actual lists but that would be secondary to the PDF to Word conversion. The code you posted doesn't make sense to me and it appears to be heading off in the wrong direction as it is applying local formatting in order to standardise. The correct approach would be to REMOVE local font formatting and if necessary, apply a style which does have the list settings. The style settings capture all the font and paragraph settings and should do everything you need apart from needing to restart list entries.

Code:
Selection.Font.Reset  'clears local font settings
Selection.ParagraphFormat.Reset  'clears local paragraph settings
WordBasic.ToolsBulletsNumbers Replace:=0, Type:=1, Remove:=1  'removes hard-coded list numbers/bullets
Selection.Style = "List"    'applies a style which presumably has automatic numbering
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #3  
Old 04-05-2021, 10:24 PM
Cendrinne's Avatar
Cendrinne Cendrinne is offline Help with access Lists Gallery to Format all Windows 10 Help with access Lists Gallery to Format all Office 2019
Competent Performer
Help with access Lists Gallery to Format all
 
Join Date: Aug 2019
Location: Montreal Quebec Canada
Posts: 190
Cendrinne is on a distinguished road
Default Thank you, Andrew...let me explain further....

Quote:
Originally Posted by Guessed View Post
When a pdf is converted back to Word, the 'list' paragraphs are going to be hard coded. You might be allowing Word to convert these to actual lists but that would be secondary to the PDF to Word conversion. The code you posted doesn't make sense to me and it appears to be heading off in the wrong direction as it is applying local formatting in order to standardise. The correct approach would be to REMOVE local font formatting and if necessary, apply a style which does have the list settings. The style settings capture all the font and paragraph settings and should do everything you need apart from needing to restart list entries.

Code:
Selection.Font.Reset  'clears local font settings
Selection.ParagraphFormat.Reset  'clears local paragraph settings
WordBasic.ToolsBulletsNumbers Replace:=0, Type:=1, Remove:=1  'removes hard-coded list numbers/bullets
Selection.Style = "List"    'applies a style which presumably has automatic numbering
1-Question, you mentioned, ''hard coded''. What is ''Hard Coded''?
2-You say you didn't understand my code, it's from the Find and Replace. So any font found, I wanted it to be at 100% size, etc. However this doesn't touch all the ''different lists''.
3- The PDF's, are given from a client, which we don't know what medium the document was done in. Would ''REMOVE local font formatting'', remove all the list?

One solution I had found previously, was to convert the Word lists to text.

Code:
    ActiveDocument.ConvertNumbersToText
So when I've selected all the document, then used that command above, I can use my previous mentioned macro to do a Find and Replace, to apply 100% to the whole document.

Reason, I didn't want to do that, is because, when I send the document to another software, it removes all the lists (number, alpha, and bullets). But temporary, I wished to keep all the lists, until I was ready. It's to be able to compare my English document and French document, make sure all the lists and bullets and paragraph are are all there, before I send it off to another software, which will remove them.

If I use Convert Numbers to Text, then it stay's there, so I have to use another macro to get rid of them before I send it to the other software.

Maybe it's not doable, to find all the list at once, to affect the scaling.

Your recent macro, could work, however, I need to find all the list names.

Thank you, Andrew, regardless, it was nice discussing this issue with an expert.

Cendrinne
Reply With Quote
  #4  
Old 04-05-2021, 11:20 PM
Guessed's Avatar
Guessed Guessed is offline Help with access Lists Gallery to Format all Windows 10 Help with access Lists Gallery to Format all Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Quote:
Originally Posted by Cendrinne View Post
1-Question, you mentioned, ''hard coded''. What is ''Hard Coded''?
2-You say you didn't understand my code, it's from the Find and Replace. So any font found, I wanted it to be at 100% size, etc. However this doesn't touch all the ''different lists''.
3- The PDF's, are given from a client, which we don't know what medium the document was done in. Would ''REMOVE local font formatting'', remove all the list?
1. Hard coded means that the numbers are part of the text rather than automatically assigned as a paragraph format. When you select paragraphs of text, if the shading of the selection includes the list numbers then I would call that 'hard coded', if the shading excludes the list numbers then the numbers are automatic and won't still be there if you change the style - they may also disappear when your 'other' software gets the text.
2. 100% size is a term relevant to html documents being viewed in a web browser. It isn't terminology used in Word formatting (other than perhaps if you are working in Web view and saving as html). Word sizes characters in points (there are 72 points in an inch).
3. Removing local font formatting allows Word to style the content according to the font attributes of the paragraph style applied to that content. All Word content is formatted firstly according to the style attributes and then it is overlaid with 'local font formatting' which records the variations from the style. It is those variations that you want to avoid - wherever possible you should get your formatting from the style and only the style.

List formatting is a paragraph format, not a font format so removing font formatting will not get rid of a list element. However, changing paragraph formatting can get rid of (or apply) list formats.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #5  
Old 04-06-2021, 08:11 AM
Cendrinne's Avatar
Cendrinne Cendrinne is offline Help with access Lists Gallery to Format all Windows 10 Help with access Lists Gallery to Format all Office 2019
Competent Performer
Help with access Lists Gallery to Format all
 
Join Date: Aug 2019
Location: Montreal Quebec Canada
Posts: 190
Cendrinne is on a distinguished road
Default

WOW, that is why you are an Expert, Andrew.
I'm going to have to reread all of this when I have more time.
I think I got the idea of what you are saying, but not all.

As for the 100%, I swear, Andrew, try yourself to convert a PDF you find online, (that has alpha numerical bullets), then convert it in Word. Click in a list type, on the alpha-numerical portion such as ==> ([a-z], [0-9]), Go To the Font window, click on the 2nd tab, look at scaling of the font.

At times, you can see with the naked eye, there is something wrong with the font. Doesn't look like the wording beside it. ie: (i) or (ii) Tab Title of that list. I see an example in front of my eyes, that (ii) Scale = 95% and Spacing = 0.9 pt.

So I've made myself a mission to figure it out to fix all instance in a word document.

One day, I will, if no one else does it.

Have a fantastic day, and again, it was truly enjoyable speaking to someone with such knowledge

Cendrinne
Reply With Quote
  #6  
Old 04-06-2021, 03:59 PM
Guessed's Avatar
Guessed Guessed is offline Help with access Lists Gallery to Format all Windows 10 Help with access Lists Gallery to Format all Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Ahh, I see what you are looking at now. The scaling on the second tab is a distortion applied to the width of the characters. In the same area, the spacing is an adjustment of the spaces between letters. These settings can be fiddled but any variation from the default comes at the expense of legibility. So resetting them to default is a good thing to do.

Your styles should already be set to 100% scaling so you really only need to reset the font attributes to the style and hence all the individual settings, including scaling and spacing, fix themselves. This avoids the need to micromanage all of the font aspects individually and allows you to control the entire document's look at the style level.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #7  
Old 04-12-2021, 11:49 AM
Cendrinne's Avatar
Cendrinne Cendrinne is offline Help with access Lists Gallery to Format all Windows 10 Help with access Lists Gallery to Format all Office 2019
Competent Performer
Help with access Lists Gallery to Format all
 
Join Date: Aug 2019
Location: Montreal Quebec Canada
Posts: 190
Cendrinne is on a distinguished road
Default

Quote:
Originally Posted by Guessed View Post
Your styles should already be set to 100% scaling
Well when we convert a PDF, which we don't know what was the source, it changes the scaling and spacing. That is the reason, I wanted to fix that in all instance in a word document.

Anyway, I found an interesting macro, to select in once intance, all the paragraph lists, and it seems to affect the Alpha-Numerical values as well. So you place the curser anywhere in the document, then click on macro, then click in the document again, you'll see it highlights all intance of lists. So change font size, change the font name.

The only thing, it won't Affect the bullets, so if I say, change all list to Arial and font 12, it seemed to do it everywhere, except all bullets. So if I have 25 new bullets styles, in a very big document, it won't touch it. You have to manually find them.

That isn't fun! Must be a magic way to fix all that?

Any way, here is the macro to find and selects all instance of paragr lists:

HTML Code:
On Error Resume Next

Application.ScreenUpdating = False
Dim Para As Word.Paragraph
With ActiveDocument
    .DeleteAllEditableRanges (-1)
    For Each Para In .Paragraphs
        If Para.range.ListFormat.ListType > 0 Then
            Para.range.Editors.Add (-1)
        End If
    Next
    .SelectAllEditableRanges (-1)
    .DeleteAllEditableRanges (-1)
End With
Application.ScreenUpdating = True
Please let me know if you find a way to Select all instance of the lists values (bullets and alphanumerical).

Cendrinne
Reply With Quote
  #8  
Old 04-12-2021, 04:42 PM
Guessed's Avatar
Guessed Guessed is offline Help with access Lists Gallery to Format all Windows 10 Help with access Lists Gallery to Format all Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

I haven't seen multi-range selections in code before and that looks like an interesting avenue to explore.

If you are looking for a 'magic' way to apply styles in PDF conversions, I would consider trying the Autoformat command which is as close to vba magic as I've seen.
Code:
  With Options
    .AutoFormatPreserveStyles = False
    .AutoFormatApplyHeadings = True
    .AutoFormatApplyLists = True
    .AutoFormatApplyBulletedLists = True
    .AutoFormatApplyOtherParas = True
    .AutoFormatReplaceHyperlinks = True
    .AutoFormatReplaceQuotes = False
    .AutoFormatReplaceSymbols = False
    .AutoFormatReplaceOrdinals = False
    .AutoFormatReplaceFractions = False
    .AutoFormatReplacePlainTextEmphasis = False
    .AutoFormatPlainTextWordMail = True
    .LabelSmartTags = False
  End With
  Selection.Range.AutoFormat
If that doesn't work, post a sample document so I can see what you are actually looking at.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #9  
Old 04-12-2021, 10:02 PM
macropod's Avatar
macropod macropod is offline Help with access Lists Gallery to Format all Windows 10 Help with access Lists Gallery to Format all Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

See also: https://www.msofficeforums.com/word/...-document.html
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Tags
gallery, list indentation, list styles

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Comparing two lists and extracting values missing from both lists Dave T Excel Programming 4 11-01-2018 11:51 PM
Creating global contact lists (distribution lists) Outlook 2011 Mac pengyou Outlook 0 09-10-2016 02:18 PM
Help with access Lists Gallery to Format all I want to create a lists within lists (nested merges) AndyS Mail Merge 10 12-11-2015 03:05 PM
Add command (not gallery) to quick access toolbar MarkPhil Word 3 02-16-2014 06:10 AM
Project gallery slidon Word 0 04-29-2013 07:22 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:26 PM.


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