Live Chat & Podcast at 1:00PM Eastern on Sunday!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Business Applications
Tag Cloud
access acer asus bios bsod computer crash desktop driver drivers error ethernet excel freeze gaming hard drive hardware hdmi internet laptop malware memory monitor motherboard network operating system printer problem ram registry router slow software sound svchost.exe toshiba trojan ubuntu 11.10 uninstall usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Software & Hardware > Business Applications >
MACRO help please

Reply  
Thread Tools
Rollin_Again's Avatar
Senior Member with 4,273 posts.
 
Join Date: Sep 2003
Location: Atlanta, GA - Planet Earth
Experience: Brilliant When Sober
01-Jun-2006, 07:51 PM #16
When you say "Drop Down" are you referring to the combo box control from the control toolbar in word?

Have you tried issuing a command like.

Code:
Documents("Document2.doc").Protect Password:="Password1", _
   NoReset:=False, Type:=wdAllowOnlyFormFields
Regards,

Rollin
zeo's Avatar
zeo zeo is offline
Member with 252 posts.
 
Join Date: Jan 2003
22-Jul-2006, 05:42 AM #17
Hi guys,

wondering if you can help me again with a slight modifcation to the code.

Currently the code inserts the running sequence number at the top left hand corner of the document.

I've now added a 2nd page to my template, which is just below the first page in word. I need the running seq number to also be inserted into the same place on the 2nd document. (Just as it is currently doing on the first).

The code that I am using to insert the number into the document is:
Code:
' This inserts the file name at the top of the document
Selection.HomeKey Unit:=wdStory

Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"FILENAME ", PreserveFormatting:=True


A copy of the full macro is below:
Code:
Sub Ordersheets()

' Automatically creates a new document in a sequentially-numbered order
' based upon the stored sequence number in MySeq text file

' Dimension the variables
Dim strMyFileName As String


' Open MySeq file and load the sequence number
MySeq = System.PrivateProfileString("\\Office\Private drive\Macro\MySeq.txt", _
     "", "MySeq")

If MySeq = "" Then
     MySeq = 1
Else
     MySeq = MySeq + 1
End If

' Update the sequence number in MySeq
System.PrivateProfileString("\\Office\Private drive\Macro\MySeq.txt", "", _
     "MySeq") = MySeq

' Load the filename string with leading zeroes
strMyFileName$ = Format(MySeq, "2000#")

' Set the filename to the new sequence number & location of where to archieve the orders docs
ActiveDocument.SaveAs "\\Office\Private drive\SAVED ORDER ARCHIEVE\" & strMyFileName$ & ".doc"

' This inserts the file name at the top of the document
Selection.HomeKey Unit:=wdStory

Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"FILENAME ", PreserveFormatting:=True

' Saves the document
ActiveDocument.Save


' Auto print
Dim sCurrentPrinter As String
  sCurrentPrinter = ActivePrinter
    ActivePrinter = "DYMO LabelWriter 400 Turbo"
    Application.PrintOut FileName:=""
    ActivePrinter = sCurrentPrinter

' close and exit
ActiveDocument.Close
Application.Quit



End Sub
__________________
My main system:
Pentium D 945 3.4GHZ 2x2mb
MSI P965 Neo
4GB 800mhz DDR2 RAM
Samsung SpinPoint F1 HD103UJ 1TB Hard Drive SATAII *32MB Cache*
ATI X1300 256MB PCI-E
LG CD/DVD/RW
LG DVD ROM
DAX SN450 PSU
XP PRO SP2

Secondary system:
Pentium D 805 2.66 GHz 2MB (1 Mb per Core)
ASRock 775DUAL-VSTA SKT 775 VIA PT880Pro/ultra
512MB DDR RAM
80GB Seagate barracuda 7200 IDE HD
NVIDIA FX5200 128MB AGP
LG CD/DVD/RW
Casecom Silver Mid-Tower
XP PRO SP1
zeo's Avatar
zeo zeo is offline
Member with 252 posts.
 
Join Date: Jan 2003
23-Jul-2006, 01:17 PM #18
bumpy bumpy
cybertech's Avatar
Computer Specs
Malware Removal Specialist with 69,217 posts.
 
Join Date: Apr 2002
Location: Washington State
23-Jul-2006, 07:07 PM #19
zeo,
I received your report to removed solved and rename the thread but you didn't say what you want to rename it to...
zeo's Avatar
zeo zeo is offline
Member with 252 posts.
 
Join Date: Jan 2003
24-Jul-2006, 06:21 PM #20
bump
zeo's Avatar
zeo zeo is offline
Member with 252 posts.
 
Join Date: Jan 2003
29-Jul-2006, 08:41 AM #21
hmmm maybe its not possible?
Reply

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 12:20 AM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.