• Andrew Lockton

    Andrew Lockton

    @andrew-lockton

    Viewing 15 replies - 1 through 15 (of 4,199 total)
    Author
    Replies
    • in reply to: Word 365—Want Fixed Nav + Style Pane sizes #494421

      Your welcome. Good to see you got it working.

      If you were going to be putting this into its own sub, I would make it a toggler to show/hide the panes by doing the following. Note that this would be a bad idea in the Auto macros.

      Sub TogglePanes()
      With CommandBars("Navigation") 'fixed pane width
      .Visible = Not .Visible
      .Width = 300
      .Position = msoBarLeft
      End With
       With CommandBars("Styles") 'fixed pane width
      .Visible = Not .Visible
      .Width = 300
      .Position = msoBarRight
      End With
      End Sub
      1 user thanked author for this post.
    • in reply to: Word 365—Macro to press Enter repeatedly #350864

      For completeness, there is an autoformat option to find text strings and turn them into hyperlinks which could have simplified the MakeLinks function

        With Options
          .AutoFormatApplyHeadings = False
          .AutoFormatApplyLists = False
          .AutoFormatApplyBulletedLists = False
          .AutoFormatApplyOtherParas = False
          .AutoFormatReplaceQuotes = False
          .AutoFormatReplaceSymbols = False
          .AutoFormatReplaceOrdinals = False
          .AutoFormatReplaceFractions = False
          .AutoFormatReplacePlainTextEmphasis = False
          .AutoFormatReplaceHyperlinks = True
          .AutoFormatPreserveStyles = True
          .AutoFormatPlainTextWordMail = True
          .LabelSmartTags = False
        End With
        Selection.Range.AutoFormat
      2 users thanked author for this post.
    • cmptrgy

      You are going off on tangents and ignoring the actual reason which I described above. This has nothing to do with paragraph numbers nor imported tags from html nor internal document corruption. The document provided by the OP contained more than 50 paragraphs so the selection of everything exceeds 50 paragraphs.

      It is easy to recreate this behaviour in a completely bland document with no formatting.

        [*]Open a new, completely empty document
        [*]Type “=Rand(50,1)” and press enter (You now have a plain document containing 51 paragraphs since there was already one in the empty document)
        [*]Do a Ctrl-A and you can see the font displays a blank
        [*]Now delete one paragraph and try again
    • I think the problem is NOT to do with the file and more likely a Microsoft-imposed limit. It appears that if you select any more than 50 paragraphs, Word doesn’t bother displaying the font in that control. This is reproducible in other documents that I created using Word 2013.

      Make a selection with up to 50 paragraphs and check the count with code in the immediate window
      ? Selection.Paragraphs.count

      Then try with more paragraphs – the font control becomes blank every time.

    • This is simpler if you just have the one form and have a hidden frame containing the second form’s content. Then you unhide the frame instead of showing a second form.

      However, without changing to a single form you can pass values between the forms like this.
      In the MainForm amend the code to pass the name of the textbox to the ToUseForm

      Code:
      Private Sub TextBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
        ToUseForm.Tag = "TextBox1"
        ToUseForm.Show
      End Sub

      Then in the ToUseForm, use the form tag to return a value

      Code:
      Private Sub ComboBox1_Change()
        Debug.Print Me.Tag
        Me.txttosend.Value = Me.ComboBox1.Value
        MainForm.Controls(Me.Tag).Value = Me.ComboBox1.Value
      End Sub
    • Have you tried the following
      { STYLEREF “APPHEADL1” n } { STYLEREF “APPHEADL1” }

    • in reply to: Setting Tabs (Word 2016) #1593487

      Have a look at this youtube video to get a solid background to tab stops
      https://www.youtube.com/watch?v=9T4_X0783c8

    • in reply to: Opening excel from word #1593030

      Chuck

      I wouldn’t approach this as a VBA problem without firstly considering other ways to do this.

      For instance, I would have thought there are already tried and true methods for distributing emails automatically. This should happen at the server level rather than the client level (since the server is ‘always on’ but the client is only on when logged in and running outlook). You create group email accounts eg staff@company.com and any emails received automatically forward to the members of that group. Your email administrator manages who is in the group and external parties don’t know the membership. This protects the individual accounts from external view and allows you to configure the members of each group whenever you like.

      I think you should post your problem to the Outlook forum here and see if someone can suggest how this can be done.

      Alternately, you could search through the forum (or wider google search) to learn the key terms. Threads like this mention keywords that I would be doing a search on. http://windowssecrets.com/forums/showthread//137983-Bad-practice-to-allow-external-users-to-send-to-Exchange-distrib-lists?highlight=email+group+distribution+exchange

      However, if you have an email administrator – just ask them.

    • in reply to: Opening excel from word #1593014

      RiverKing – I don’t know how much time you’ve spent, nor what you’ve already achieved so I have no idea on whether you’ve wasted any time at all.

      Yes you can use VBA to have different applications talk to each other. You can drive Outlook from Excel or vice versa. Elements of Axbean’s code could be adapted for your purposes but it’s certainly not the complete solution. You could code this from two directions. Either Outlook appends a record in Excel everytime a mail arrives OR Excel queries Outlook when you ask it for an update on what emails have arrived. It isn’t necessary to always maintain the Excel file in step with the email status if no-one is actually looking at the Excel document.

      I’m not sure on your terminology. “Ready to start throwing code” sounds like you could be frustrated and deleting things you’ve already done OR are about to start writing code.

      If you do some google searches for keywords such as “VBA Outlook NewMail Event” then you can get some ideas on how to trigger a macro when an email arrives. This information could then be used with elements of the code above to come up with a solution.

    • Gary

      To update the SELECTED fields, F9 is the command you should use. So to update all the fields, Ctrl-A then F9.

      Alt-F9 is usually set to toggle the field codes for the entire document – not just the selected ones. This doesn’t update the fields, just toggles them between viewing the field codes and viewing the field results.

    • in reply to: SaveAs/Startup folder #1592891

      That is interesting. Doing a google search, it appears this is because the file is locked to all but a single user.

      But I have no idea on what is happening to cause that to happen without you making active steps as administrator to do so.

    • I think it is consistent and good for regular use.

      You will encounter problems if both CCs differ in their setting to allow line breaks and for that reason I wouldn’t recommend you tinker with that setting.

      I don’t use Word 2106 much but haven’t run into problems there as yet.

    • If you apply the “do not delete” property to any mapped content control, that change applies to all copies of it.

      Charles
      Are you sure about that? I don’t see that behaviour in Word 2013. This might be a semantics issue though – if I copy a CC to multiple places then the properties on the original get pasted to the multiple places too. But I can then alter the properties on any of those CC instances so that one of them CAN be deleted or edited.

      James
      If your template only needs a few different mapped CCs then make use of the built-in ones available. For instance you could arbitrarily insert a ‘Category’ CC and then change its Title property to ‘Publication Number’. If you wanted to also set its placeholder text so its default empty value prompts the author too then you can go to the Developer > Design Mode and edit the text in [grey]. Don’t remove the square brackets unless you want to change the appearance of the default text. Note that once the CC has content you won’t see the placeholder text and its appearance will be as per the style applied.
      46852-CC_Properties

    • James/Janine

      You need to be careful of terminology here. You have mentioned a RichText CC multiple times here but the Abstract doc property is a Plain Text CC. If it was a Rich Text CC you would be able to put multiple paragraphs in there and use more than one style. You ‘can’ change the CC property to allow carriage returns but in practice this is actually a soft return and not a new paragraph.

      When you go to Insert > Quick Parts > Document Property you get a CC that is ALREADY linked to a built-in document property. None of those are Rich Text CCs. If you only need to link a limited number of CCs then this is an easy way to do it since the linking is already in place.

      If you want a date to be in the CC, the only one built in is Publish Date which uses a Date Picker CC. This is great and can be formatted in different ways in different locations.

      You can also add other CCs via the Developer Tab and can link them to your own embedded XML by using Greg Maxey’s template. However, Rich Text CCs and linked XML is NOT a match made in heaven :o: so you are likely using Plain Text CCs for most of that work.

    • in reply to: SaveAs/Startup folder #1592329

      I’m not sure I understand what is going on but working on an add-in while it is loaded is fraught with danger/confusion. In effect, Word has opened a read-only copy as the add-in loads and then you are probably opening a second ‘writable’ copy in order to edit it as the ActiveDocument. It is no surprise that you get somewhat dodgy behaviour.

      Try removing it as an add-in before editing the template and see if you get more predictable behaviour.

    Viewing 15 replies - 1 through 15 (of 4,199 total)