• mvpjjf

    mvpjjf

    @mvpjjf

    Viewing 15 replies - 16 through 30 (of 208 total)
    Author
    Replies
    • in reply to: Macro help: Creating text box in Word from other application #1466490

      I don’t have CorelDraw to play with, but this code works as a macro in Excel after setting a reference to the “Microsoft Word xx.x Object Library” (where xx.x is whatever Office version you have on the computer).

      Code:
      Sub WordPlay()
      Dim wrdApp As Word.Application
      Dim wrdDoc As Word.Document
      Dim i As Integer
      Dim Box As Word.Shape
      
      Set wrdApp = CreateObject(“Word.Application”)
      wrdApp.Visible = True
      Set wrdDoc = wrdApp.Documents.Add ‘ create a new document
      
      
      With wrdDoc
          For i = 1 To 2
              .Content.InsertAfter “Here is a example test line #” & i
              .Content.InsertParagraphAfter
          Next i
          
          Set Box = .Shapes.AddTextbox( _
              Orientation:=msoTextOrientationHorizontal, _
              Left:=InchesToPoints(1), Top:=InchesToPoints(2.5), _
              Width:=InchesToPoints(4), Height:=InchesToPoints(2), _
              Anchor:=.Paragraphs(1).Range)
          Box.TextFrame.TextRange.Text = “Text in box” & vbCr & “Second line”
      End With
      
      End Sub
      
    • in reply to: Word 2013 #1459827

      To save a preview in every document, open the Normal.dotm template (using File > Open and navigating to the Templates folder), press F12 (the Save As command), and check the Save Thumbnail box in the lower left part of the dialog before clicking OK. Repeat for every other template that you use regularly. That will cause the same box to be checked in the dialog the first time you save every document.

      If you expect to see the previews in Word’s Open dialog (or the same for workbooks in Excel or slide decks in PowerPoint) it isn’t going to work because of this long-standing bug. Since you can see previews in Windows Explorer even for documents that don’t have saved thumbnails, you might as well not bother saving them at all.

    • in reply to: Old File Menu #1459822

      Go to File > Options > Save and check the option “Don’t show the Backstage when opening or saving files”. Then always use the Ctrl+O shortcut, which will display the Open dialog directly. The dialog will initially show the folder that you enter in the “Default local file location” box on the same Options page.

    • in reply to: MS OFFICE & merge & Labels #1456520

      It sounds like you’re only using the Preview Results button, which shows one page at a time. Click the Finish & Merge button instead, and choose either to print immediately, or to merge to a new document (the Edit Individual Documents choice)

    • There are a couple of ways to find the name of the attached template by using buttons on the ribbon, but if that happens to be the Normal template then all you’ll see is “Normal” and not the folder path — not helpful. To see the full path regardless of which template is attached, follow these steps:

        [*]Press Alt+F11 to open the macro editor.
        [*]Press Ctrl+G to open the Immediate window at the bottom right.
        [*]Type or paste this line in the Immediate window and press Enter:

      [INDENT]Print ActiveDocument.AttachedTemplate.FullName[/INDENT]

    • Are you using the old printer driver, the newest (October 2009) driver from HP, or the driver that comes with Windows 7? If it isn’t the newest one, download that from http://h10025.www1.hp.com/ewfrf/wc/softwareCategory?cc=us&lc=en&product=61818 to see if that improves the behavior.

    • RandyMc: To clear up a possible misconception: Selection.Fields(1) does not mean the same thing as ActiveDocument.Fields(1). Instead, Selection.Fields(1) refers to the first field of which any part is contained in the Selection. If the Selection happens to be in the 15th field in the document, then Selection.Fields(1) and ActiveDocument.Fields(15) are the same field. Paul’s code uses the same idea, except that it mentions the .Fields(1) of a Range object.

    • I’d like to add a comment on why Andrew’s answer is the best solution.

      In order to create a vertical bar in the margin next to a table without using tracked changes, you would have to insert a line Shape with text wrapping other than in-line. You would have to calculate the length of the line to match the height of the changed matter, which is not a simple job if there are non-text elements, multiple paragraphs with different Space Above/Below settings, various font sizes, etc. Once all that’s done, there is no good way to lock floating shapes against being dragged — only their anchors can be locked.

      Using real tracked changes avoids all this agita.

    • in reply to: How to add my editor to right-click menu #1447016

      Right-click a text file and click Open With. Assuming UltraEdit doesn’t appear in the list (it didn’t for me, either), click “Choose default program”. If you still don’t see UltraEdit, click “More options”. It probably won’t be in the expanded list, either, so scroll all the way to the bottom and click “Look for another app on this PC”. Then you’ll get the standard Open dialog, where you can navigate to the folder (in my case, C:Program Files (x86)IDM Computer SolutionsUltraEdit-32) and click on the executable file uedit32.exe, then click the Open button.

      That makes UltraEdit the default program for .txt files — they’ll display the UltraEdit icon, and double-clicking the text file will open it in UltraEdit. The program will also appear in the Open With list on the right-click menu, but only for .txt files and not for other types.

      There’s also a File Associations category in the Advanced > Configuration dialog inside UltraEdit, but I haven’t been able to make it do anything on Win8.1.

    • in reply to: Duplex printing and Section Breaks (Odd Page) #1447012

      If all else fails, here’s an old article showing how to use a page break in an IF field to force a blank even page at the end of a chapter — you don’t need section breaks if you use this.

      If you want the blank page to be completely blank, don’t put the “This page is intentionally blank.” statement into the field; leave just the page break between the quotes.

    • I have a problem with an older pc that will take manual fixing.

      Plug and play is not recognising anything.

      I will have to go into the registry and put in the devices.
      Then point to the drivers somehow.
      Insert the drivers somewhere.
      And who knows what all other links and references windoze uses.

      With 25 years of experience in writing Windows installation packages, I can guarantee that you won’t be able to fix USB or other OS-related problems by making manual changes in the registry. Besides the dozens to hundreds of barely documented entries you’d need to deal with, there are entries that Windows won’t allow you to edit.

      The only way to fix those problems is to reinstall at least the drivers, and possibly all of Windows as mrjimphelps described, using the official installers.

    • in reply to: office location #1439831

      It isn’t clear what “primarily located” means in this case. The executable files for the Office programs will be found in C:Program FilesMicrosoft Office 15rootOffice15.

      If you want to know about other major locations, list the ones you’re interested in. Many of them (e.g., the default document folder and the default template folder) can be configured per user through the Options dialog in each program.

    • in reply to: Problems with Office 2003 and 2010 together plus new email #1439236

      What I’m wondering is this: If I remove Office 2003 via the control panel, will that cause havoc with my 2010 installation? I’d like to keep some of the macros and dot files I used with Word 2003, but I’m not quite sure where they’re hidden. I’m also not quite sure if 2010 uses ACL files or where to find my old ones.

      While mrjimphelps’ advice to uninstall both versions and then install only 2010 will do the job, it shouldn’t really be necessary. You can uninstall Office 2003, and then run a Repair of 2010 (in the Control Panel | Programs and Features, click on Office 2010 and click Change at the top of the window, then select Repair on the first page of the wizard). That will make sure the registry entries are correct for matching document types with default programs.

      Uninstalling Office 2003 will not remove any of its documents, templates, macros, AutoCorrect entries, or add-ins. They’ll still be available for use in Office 2010. You should find the templates in the folder %appdata%MicrosoftTemplates, which Word 2010 also uses. Similarly, Word 2010 uses the same ACL files for AutoCorrect; you’ll find them in %appdata%MicrosoftOffice.

      If you make a new document in Word 2010 based on a .dot template from Word 2003, it will say “Compatibility Mode” in the title bar, and some of the features of Word 2010 will be disabled. To fix that, open the template file itself (from File > Open), click File and click the Convert button, then save the template as a .dotx (non-macro) or .dotm (macro-enabled) template.

      Most macros written for Word 2003 will work as is in Word 2010. The exceptions are mainly ones that work with or modify the menus and toolbars, which don’t exist in Word 2010, and ones that use the FileSystemObject (see http://www.mrexcel.com/forum/excel-questions/643288-excel-2010-visual-basic-applications-replacement-application-filesearch.html for a replacement).

    • in reply to: Windows 7 Explorer, folder pane – resolution? #1437019

      You can change the behavior of Win 7’s Explorer to fix the first problem (expanding the folders in the left pane): Click Tools > Folder Options. On the General tab of the dialog, check “Automatically expand to current folder” and click OK.

      I see the “jumping away” behavior, and I don’t know of any fix for that.

    • in reply to: Need help with simple macro #1435339

      Why are you stuffing everything into a collection and then pulling it out again? It’s more efficient (and has fewer mysterious problems) if you just transfer each piece as you find it.

      There are other things here to think about. First, using Selection.Find forces Word to scroll and render pages, which slows the execution — often by an order of magnitude. Instead, use a range object’s .Find, which doesn’t cause any scrolling. Second, your pasting would put all of the found items one after the other, without any intervening space or paragraph mark. Third, each pasted item will end with an incomplete tag, just the left bracket and the slash.

      Try this replacement:

      Code:
      Public Sub GenerateDocument(Tag As String)
       
          Dim createdDocument As Document
          Dim rg As Range
      '    Dim destRg As Range ' see "alternatively" comment below
          
          Set rg = ActiveDocument.Range
          Set createdDocument = Application.Documents.Add
      '    Set destRg = createdDocument.Range
          
       On Error GoTo err:
          'find all the matching bits
          With rg.Find
              .Text = "[" + Tag + "]*[/"
              .Forward = True
              .Wrap = wdFindStop
              .Format = False
              .MatchWildcards = True
              While .Execute
                 createdDocument.Range.InsertAfter rg.Text & vbCr
                 ' alternatively, to include formatting:
      '           destRg.FormattedText = rg.FormattedText
      '           destRg.InsertAfter vbCr
      '           Set destRg = createdDocument.Range
      '           destRg.Collapse wdCollapseEnd
              Wend
          End With
          Exit Sub
          
      err:
         MsgBox "GenerateDoc: " & err.Desciption
      End Sub
    Viewing 15 replies - 16 through 30 (of 208 total)