Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-07-2017, 02:46 PM
dwirony dwirony is offline New to VBA Windows 7 64bit New to VBA Office 2003
Advanced Beginner
 
Join Date: Oct 2016
Posts: 49
dwirony will become famous soon enough
Default


Instead of "MsgBox Pwd(8), try:

Code:
ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=2, NumColumns:= _
        1, DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:= _
        wdAutoFitFixed
    With Selection.Tables(1)
        If .Style <> "Table Grid" Then
            .Style = "Table Grid"
        End If
        .ApplyStyleHeadingRows = True
        .ApplyStyleLastRow = False
        .ApplyStyleFirstColumn = True
        .ApplyStyleLastColumn = False
        .ApplyStyleRowBands = True
        .ApplyStyleColumnBands = False
    End With
    Selection.TypeText Text:="Password"
    Selection.MoveRight Unit:=wdCell
    Selection.TypeText Text:=Pwd(8)
Reply With Quote
  #2  
Old 04-11-2017, 05:02 AM
DeductiveBear23 DeductiveBear23 is offline New to VBA Windows 10 New to VBA Office 2016
Novice
New to VBA
 
Join Date: Apr 2017
Posts: 4
DeductiveBear23 is on a distinguished road
Smile I will Give it a try

Thank you DW. I will try to make time later today and try your code and will post back to let you know how I make out.

Regards,
Reply With Quote
  #3  
Old 04-13-2017, 08:44 AM
DeductiveBear23 DeductiveBear23 is offline New to VBA Windows 10 New to VBA Office 2016
Novice
New to VBA
 
Join Date: Apr 2017
Posts: 4
DeductiveBear23 is on a distinguished road
Default New Code Error Received

Hi DW,

I have finally found a minute to try the code you suggested and I have developed a compile error. "Invalid outside Procedure". Do you have any suggestions?
Reply With Quote
Reply

Tags
msg box, table, vba in microsoft word



Other Forums: Access Forums

All times are GMT -7. The time now is 11:30 PM.


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