Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-19-2020, 12:49 AM
Steve2081 Steve2081 is offline Checkbox code Windows 7 64bit Checkbox code Office 2016
Novice
Checkbox code
 
Join Date: Apr 2020
Posts: 25
Steve2081 is on a distinguished road
Default Checkbox code


Can anyone help?
I have a word doc that contains tables on each page. I've customised the ribbon so I have buttons which allow me to send the table on the corresponding page to outlook, convert it to PDF so it can be sent to a recipient. However this only allows me to send one converted pdf at a time. I wondered if there was code that I could add to allow me to utilise checkboxes, so the selected checkboxes/pages would all be sent in one email.
Reply With Quote
  #2  
Old 05-19-2020, 01:41 AM
Guessed's Avatar
Guessed Guessed is offline Checkbox code Windows 10 Checkbox code Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 1,578
Guessed is just really niceGuessed is just really niceGuessed is just really niceGuessed is just really niceGuessed is just really nice
Default

If you provided the existing code along with a sample doc it would be easy enough to provide you the relevant code modifications. In the absence of that, your code could cycle through a collection of Content Controls and create a function that processes each ticked CC based on the page it resides on.
Code:
Sub ProcessPages()
  Dim aCC As ContentControl
  For Each aCC In ActiveDocument.ContentControls
    If aCC.Checked Then
      MsgBox "This page has a checked CC: " & aCC.Range.Information(wdActiveEndPageNumber)
    End If
  Next aCC
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #3  
Old 05-19-2020, 04:41 AM
Steve2081 Steve2081 is offline Checkbox code Windows 7 64bit Checkbox code Office 2016
Novice
Checkbox code
 
Join Date: Apr 2020
Posts: 25
Steve2081 is on a distinguished road
Default

I'm happy to supply a sample doc with code.
how do I do that?
Thanks
Reply With Quote
  #4  
Old 05-19-2020, 05:31 AM
Guessed's Avatar
Guessed Guessed is offline Checkbox code Windows 10 Checkbox code Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 1,578
Guessed is just really niceGuessed is just really niceGuessed is just really niceGuessed is just really niceGuessed is just really nice
Default

You can attach a file to a post by clicking the Go Advanced button and click on the paperclip button, then select a file and upload
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #5  
Old 05-19-2020, 05:47 AM
Steve2081 Steve2081 is offline Checkbox code Windows 7 64bit Checkbox code Office 2016
Novice
Checkbox code
 
Join Date: Apr 2020
Posts: 25
Steve2081 is on a distinguished road
Default

pe.zip

Managed it with a compressed file. Please let me know if it attached ok.

pe file is the main doc, with 360 as the temp
Reply With Quote
  #6  
Old 05-19-2020, 07:56 PM
Guessed's Avatar
Guessed Guessed is offline Checkbox code Windows 10 Checkbox code Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 1,578
Guessed is just really niceGuessed is just really niceGuessed is just really niceGuessed is just really niceGuessed is just really nice
Default

In looking at your sample documents (which don't appear to contain CCs), I would like to take a step back and work out the ideal output document(s) and then work out an efficient workflow to produce it. I can see you can produce ribbons and assemble code from various places so you should be able to achieve a good result if you have a good plan.

Firstly, what do you want to produce?
I presume the patient would appreciate a single document which contains a cover page with a tabular summary of recommended exercises listing Reps/Sets/Rest. That would then be followed by the detailed descriptions/video link of each exercise. The cover page could then be their printed cheat sheet used for each workout whilst the other pages would be likely viewed once and less useful than the summary.

Once you have a clear picture of what you want to produce, it becomes easier to plan the most efficient way to produce the output doc. The most efficient way needs to be not just how does the Physio produce a customised workout plan quickly but also, how do new exercises get added to the template over time with new exercise choices for the Physio to select from.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #7  
Old 05-20-2020, 12:56 AM
Steve2081 Steve2081 is offline Checkbox code Windows 7 64bit Checkbox code Office 2016
Novice
Checkbox code
 
Join Date: Apr 2020
Posts: 25
Steve2081 is on a distinguished road
Default

Thank you for your time on this.
This doc is meant to be a catalogue of exercises which our team can access quickly and easily. It is going to be on a hospital shared network drive for all therapists, therefore the selection of the 'Word@ program was based on the software we have available. Our IT department are very strict when it comes to allowing access to new software.

At the moment the doc opens to a contents page with heading of grouped exercises e.g. squats as one category another balance exercises as another. I've hyperlinked these headings so they automatically take you to the desired sub content page for that category. Click on the word squats, it takes you to a page or 2 which lists the available squat. The therapist can scroll through these to chose which one they want, click on the hyperlinked photo/name of exercise and it takes you to that page. This is where the written explanation of the exercise is, alongside images (this can be 1 or as many as 8, but with more exercises this may change). The images are hyperlinked to the hospital youtube channel so patients can access the videos as well. With the current code it only sends one page at a time, but it would be nice to have the option to send multiple pages in one email or have the selection of exercises convert to a single exercise program in a new doc/pdf which lists them one after the other.

The ribbon is also a contents page of sorts, that links to the sub-contents pages. Whilst the therapist is choosing the exercise they have the option to print the page or email it to the patient. This page is then converted to PDF and sent to outlook. I've added subject matter and some body text stating this is a 'don't reply to this email'. Its not which is something I'd like to be able to do to, prevent patients for directly replying as the likely hood is that therapist will use their personal work email account to send the email. Unless there is also code that would select a specific account to send the email from which could be changed to 'send only account'.

What I have found so far with the current code is that instead of selecting the page it selects the table on the page and it contents. The code doesn't work if cells are merged. Also if I change the page orientation on the word doc using page breaks, this makes all converted pages portrait, therefore some of the information is cut off.

I'm fairly new to coding and not sure how to write macros. Is there a macro that could set up specific page layout whether it be in portrait or landscape? I wondered if this would be an efficient way to add new exercises at a later date. Otherwise I have lots of table stored and the end of the doc which I can add the information to.

I want the person who uses the catalogue to have quick access to the functions e.g. print or email without having to go through the normal 'Word process of file/print/select pages etc. What we are also doing in our department right now is moving from paper to e-notes, so having the ability to upload the exercise program to these notes would also be great. We haven't chosen a software program for that yet but hope to soon.

I'm not sure if that's helpful. Any thoughts/suggestions will be great thanks.
Reply With Quote
  #8  
Old 05-27-2020, 03:19 PM
Guessed's Avatar
Guessed Guessed is offline Checkbox code Windows 10 Checkbox code Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 1,578
Guessed is just really niceGuessed is just really niceGuessed is just really niceGuessed is just really niceGuessed is just really nice
Default

Steve

Yes I do have some thoughts and was putting it together in a template but didn't finish it and was swamped with work before I got there. I'm finishing a big job today and will be able to revisit this tomorrow.

Long story is I would be saving the 1-pagers as building blocks in the template. If page setup varies, include a section break after the page in the building block. Then put a gallery (like the quick parts one) on your ribbon to make all the options available. Then have a separate button to send the email.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #9  
Old 05-28-2020, 11:02 AM
Steve2081 Steve2081 is offline Checkbox code Windows 7 64bit Checkbox code Office 2016
Novice
Checkbox code
 
Join Date: Apr 2020
Posts: 25
Steve2081 is on a distinguished road
Default

Hi Andrew
thank you for your time on this I really appreciate any help you can provide.
Reply With Quote
  #10  
Old 05-31-2020, 08:05 PM
Guessed's Avatar
Guessed Guessed is offline Checkbox code Windows 10 Checkbox code Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 1,578
Guessed is just really niceGuessed is just really niceGuessed is just really niceGuessed is just really niceGuessed is just really nice
Default

Steve

I've attached a modified version of your template showing three alternative ways to make exercises available to the Word document. All rely on storing each exercise as a Building Block in the template but differ in how you introduce that content into the document. You can add each exercise sheet as a building block in the template and by assigning the right BB type and category, get it to appear in the right gallery.

Two of the methods use built-in galleries to display building blocks, whilst the other method uses a macro to bring in the exercise which enables you to include other functionality such as a 'table of contents' type summary and autocompleting the reps, sets info in both places.
Attached Files
File Type: dotm 000 SamplePhysio.dotm (476.5 KB, 4 views)
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #11  
Old 06-01-2020, 03:40 AM
Steve2081 Steve2081 is offline Checkbox code Windows 7 64bit Checkbox code Office 2016
Novice
Checkbox code
 
Join Date: Apr 2020
Posts: 25
Steve2081 is on a distinguished road
Default

Hi Andrew
So far I'm liking the dynamic gallery and the BBCC.
When I'm saving certain pages to the template, then open it as a new doc, the formatting changes. i.e. on the template the tables fitted onto the page, but the on the word document they then spread over 2 pages. Is there a way to change this?


Thank you
Reply With Quote
  #12  
Old 06-01-2020, 04:59 PM
Guessed's Avatar
Guessed Guessed is offline Checkbox code Windows 10 Checkbox code Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 1,578
Guessed is just really niceGuessed is just really niceGuessed is just really niceGuessed is just really niceGuessed is just really nice
Default

I would probably choose the dynamic gallery and make use of all the BB types to have a gallery aligning with each body area. eg Autotext = Ankle; Custom Autotext = Core; QuickParts = Knee; etc.
If you go with the BBCC then you can create your own categories within the one BB type but I think the useability is less intuitive.

With the pagination, are you changing the page setups and adding section breaks? You had mentioned previously that you wanted some portrait and some landscape layouts and this would require section breaks if in the same doc. But then again, it also appeared you wanted to send each exercise out as a separate file which didn't sound like it was the best solution.

The pagination shouldn't change from saving the doc and closing and then reopening. That could conceivably happen if styles updated on open but not if the same template was still attached. However, changing printers 'can' cause pagination issues especially if opened on a different computer. You avoid this issue by making your 1 page exercises fit easily on the page (with a little extra space to spare) and include a 'Page break Before' setting on the style used for the exercise title which ensures it always starts on a new page.

I would highly recommend you make all exercises fit on the same page setup (either portrait or landscape) so you don't make this more complex than it needs to be.

If you 'must' go with a mixture of portrait and landscape, you will need to include a section break after each exercise since this is where the page setup info is stored. That section break would need to be included in every BB you store.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #13  
Old 06-02-2020, 06:36 AM
Steve2081 Steve2081 is offline Checkbox code Windows 7 64bit Checkbox code Office 2016
Novice
Checkbox code
 
Join Date: Apr 2020
Posts: 25
Steve2081 is on a distinguished road
Default

I've sorted the layout issue, thank you.
I really like the BBCC format. Please could you explain the process of adding more categories and exercises.
Also I use the office ribbon editor, I have changed the email image successfully however I'm struggling with icons for the dynamic gallery and bbcc gallery. Do you know how to change these icons?

thank you again.
Reply With Quote
  #14  
Old 06-02-2020, 09:27 AM
Charles Kenyon Charles Kenyon is offline Checkbox code Windows 10 Checkbox code Office 2019
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 6,536
Charles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to behold
Default

You can change/add categories in the dialog to add building blocks. You can move and edit everything set in that box using the Building Blocks Organizer.

You may have already received a link but if not: Build & Deploy Custom Building Block Galleries by Greg Maxey
Reply With Quote
  #15  
Old 06-02-2020, 04:20 PM
Guessed's Avatar
Guessed Guessed is offline Checkbox code Windows 10 Checkbox code Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 1,578
Guessed is just really niceGuessed is just really niceGuessed is just really niceGuessed is just really niceGuessed is just really nice
Default

Charles has provided a couple of excellent links which answer your specific questions along with providing a heap more information. Let us know if you get lost and can't find the wood amongst the trees.

Get everything else working before you go playing with those button icons. Focus on usability and making it easy to use. Usability is not just from the physio's point of view - it needs to include how the patient gets and uses the output as well as how you go about adding or changing exercises in the template and rolling that out to the physios.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Checkbox code Check Boxes Not Displayed via MailMerge CheckBox Insertion code JennEx Mail Merge 2 05-28-2019 05:55 PM
Checkbox code One Content Control Checkbox checks another Content Control Checkbox DEsh Word VBA 2 10-06-2017 08:23 PM
Copy ActiveX-Checkbox with code DanielM125 Word VBA 0 06-04-2015 12:49 AM
Checkbox code Uncheck Checkbox Code not working if document protected bandrist Word VBA 2 08-14-2013 09:02 AM
Excel ->VB code for Checkbox (control toolbox) kirkstyle Excel 0 08-16-2006 04:17 PM

Other Forums: Access Forums - Senior Forums

All times are GMT -7. The time now is 02:51 AM.


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