Ok, I'm a newbie to this, but I see where you're going.
I need to start my code with the dialog box, then make something like this? I'm struggling with the right syntax.
ActiveDocument.InLineShape.Count
'Somehow select the last Shape
'Convert it to a Shape
'proceed with rest of my code.
Can...
Hi, thanks for the help.
I was testing whether I could format the picture, which I now have successfully done. However, when I was testing, I hard-coded the filename.
Now, I need to change and put up a dialog for the user to select their image, then run the code to format as necessary...
From what I understand, when inserting a file (or object) it comes in as InLineShape. I need it converted to Shape so I can modify it appropriately to be behind text, etc. If you look at the latter part of my code you will see I use the ShapeRange to control the Shape (or picture).
So does...
I did try SetmyShape = Dialogs(wdDialogInsertPicture).Show
But I get an error. I also did try the GetOpenFileName before, but for some reason, I could not figure out what the Shape was called (named). Then I couldn't modify it. THis is the farthest I've come and the code works perfectly, but...
I had some trouble with this, but I finally got it to work. Problem I have now is I need to allow the user get select a file, via Insert Picture from File as opposed to me hard coding the path. I'm not sure how to get this in and then perform the formatting steps I need afterwards...
Any help...
I need to insert a graphic then further format it. However, for some reason, once a picture is inserted, I lose "focus" and can't control it. I've looked everywhere and even some archived posts here, and they don't work. I've copied one. Mostly, if I could figure out how to name a Shape...
STUPID ME! I forgot a \ at the end of my path.
Syntax drives me nuts sometimes.
Thanks to all for your help!
Tom, you also said something about ExpandEnvironmentString. I just wanted to research that so I can become more aware of code. Is there a link you can refer me to for more info...
No, no copy is allready there, besides wouldn't the Overwrite attribute take care of that?
I guess another way I'm going to attempt is copy it to the desktop and then try moving it to that folder. This is just bizzare.
I get the exact path I need with the WScript.Echo.
When I replace it with the CopyFile, it says access denied. I did get the last bit of code to work and it did copy to my desktop. I have full Admin rights to this local test machine, so something else must be awry. If I got it to my desktop...
Thanks so much. It does seem to work, but now I get a permission denied when copying. Why would that be?
dim WSHShell, objFSO, desktop, pathstring, Rootpath, TemplatePath
Set WSHshell = CreateObject("WScript.Shell")
set objFSO=CreateObject("Scripting.FileSystemObject")
desktop =...
Ok, I added teh code form mharcourt, and it gives me a message "76 Path not found"
markdmac, so you're saying I should abandon %UserName% and use SpecialFolders("Desktop") & "\Application Data\Microsoft\Templates"
Ok, I tried it witih Special Folders and it did copy to my desktop. :)
How...
I have a simple script to copy a file from a server (network) to a local machine.
I am in a Windows domain and I can't use a mapped drive letter as this would be used by several people. I figured I could copy a file directly by using \\server\folder\etc but my code just stops and says Path not...
I'm looking to create a script in Corel PhotoPaint version 9 or 12, where I can use the Image (or Mask selector) and when I draw a box around an image, it will automatically, save the selection as a JPG and perform some basic effects such as Auto Equalize, Dust & Scratch Removal, etc. I can...
And Thank you Again. I had to dim the oFSO, to get the code to work.
While I'm on this topic, I was experimenting, trying to get my brain wrapped around this. Why couldn't I use the FileCopy command like this. It will make the folder, but won't actually copy the file into the destination...
Furthermore, if I can get it to work, it seems to make the folder but not copy the file. It keeps making a filename called 09-20-2004 with no extension.
I keep getting an object not defined for line 7, which is the 'Variable is undefiend: oFSO
So I've tried making a variable for oFSO, and even setting it to the filesystem object, but that doesn't work either.
I've tried distorting my code each and every way, and it seems, I just don't...
Here's what I was trying:
Option Explicit
Dim ofile
Dim fso
set fso = createobject("scripting.filesystemobject")
set ofile = fso.getfile("Z:\Cover.jpg")
ofile.copy("c:\Archive\" & Month(Now()) & "-" & Day(Now()) & "-" & Year(Now()))
Set ofile = Nothing
Do I need to find out the name of the...
One further step.
Now that I have my folder created. How do I tell the fso to copy a file from a "concrete" source to this variable folder?
I can't use an actual name for this folder when specifying the destination, since it will change...
Tom, you are awesome. I'm trying to be an aspiring programmer, and I constantly read through the postings here on Tek-Tips, and I have to say you are so helpful.
One quick question, why would I have to set oFSO = Nothing afterwards?
How would I go about creating a folder based on today's date? Such as '9-17-04'
I've seen some things posed about CurrentDate or something, but it's way too much, since it has the time stamp as well.
I'm making a simple archival tool, but I'm at a loss as to creating a folder with a...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.