-
November 21st, 2009, 12:28 PM
#1
Macro in Word 2007
Hi all and thanks for reading,
I am new at VB programming and am beating myself crazy on how to save a Word document using a user input in the document. Let me clarify, I have a document created with a macro that inserts the date, tracks it with a sequential number (using bookmarks with a text file) and saves it to our shared drive on the network (see below). I want the ability use the macro to save the document with a user input so to keep all documents organized. Maybe using their company ID or name. Any help would be greatly appreciated!
ActiveDocument.Bookmarks("Date").Range.InsertBefore Date
Order = System.PrivateProfileString("S:Sample.Txt", "MacroSettings", "Sample")
If Order = "" Then
Order = 1
Else
Order = Order + 1
End If
System.PrivateProfileString("S:\Sample.Txt", "MacroSettings", "Sample") = Order
ActiveDocument.Bookmarks("Sample").Range.InsertBefore Format(Order, "0000#")
ActiveDocument.SaveAs FileName:="S:\Sample " & Format(Order, "0000#")
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|